O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — creating a simple layout file

In this section, we'll create a simple layout file called layout.php. Remember that in our render function, there is a default value for $layout, and that is set to layout. This means that, by default, Bones will look for views/layout.php. So, let's create that file now.

  1. Start by creating a new file in our views directory called layout.php.
  2. Add the following code in the newly created views/layout.php:
    <html>
    <body>
    <h1>Verge</h1>
    <?php include($this->content); ?>
    </body>
    </html>
    

What just happened?

We created a very simple HTML layout that will be used in all of our views in the application. If you remember, our render function in Bones uses the path set as the $content variable that we set in the previous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required