title: Cakephp 3.0.3 How do I use the default layout?
body: <p>I just installed cakephp 3.0.3 with composer and I am running the built in development cake server to view my site. I have only made two changes to the project. After working with the project for a little while, I realized the default.ctp layout is not loading on my pages.</p>
  
  <p>The first thing I did was configure the database connection to MySQL. The next thing I wanted to do was include bootstrap and jQuery. Naturally, I followed the cakephp cookbook and put the css and js in their appropriate folders under webroot. Next I linked to those files in src/Templates/Layout/default.ctp. </p>
  
  <p>At first when they did not show up, I guessed it must have been an issue with the command linking them, but when I tried to add other content to be displayed within default.ctp, I realized that the layout is not rendering at all.</p>
  
  <p>I am totally new to cakephp and php, but I read straight from the cookbook and just followed their example, I don't know why the default layout would not be loaded at all.</p>
  
  <p>I tried to change the appController to include <code>$this-&gt;layout = 'default';</code> as suggested <a href="https://stackoverflow.com/questions/7426469/assigning-layout-in-cakephp">here</a> but that just gave me a strict error saying that appController beforeRender() must be compatible with Controller beforeRender() so I just changed it back to the way it was by default.</p>
  
  <p>I am using OS X Yosemite and Google Chrome to view the page if that makes a difference. Everything on the default homepage has check marks saying that everything is installed and configured properly, and I have seen other people that have similar issues where mod_rewrite is their problem but I do not have any errors about mod_rewrite.</p>
  
  <p>Here is my default.ctp:</p>
  
  <pre><code>&lt;?php
  /**
   * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
   * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
   *
   * Licensed under The MIT License
   * For full copyright and license information, please see the LICENSE.txt
   * Redistributions of files must retain the above copyright notice.
   *
   * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
   * @link          http://cakephp.org CakePHP(tm) Project
   * @since         0.10.0
   * @license       http://www.opensource.org/licenses/mit-license.php MIT License
   */
  
  
  
  $cakeDescription = "Children's Medical Group";
  ?&gt;
  
  &lt;!-- This layout is loaded for controller view content --&gt;
  
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;?= $this-&gt;Html-&gt;charset() ?&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;title&gt;
          &lt;?= $cakeDescription ?&gt;:
          &lt;?= $this-&gt;fetch('title') ?&gt;
      &lt;/title&gt;
      &lt;?= $this-&gt;Html-&gt;meta('icon') ?&gt;
  
      &lt;?= $this-&gt;Html-&gt;css('base.css') ?&gt;
      &lt;?= $this-&gt;Html-&gt;css('cake.css') ?&gt;
  
      &lt;?= $this-&gt;fetch('meta') ?&gt;
  
      &lt;!-- The following css and js elements are for bootstrap --&gt;
  
          &lt;!-- Latest compiled and minified CSS --&gt;
      &lt;!-- &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt; --&gt;
      &lt;?= $this-&gt;Html-&gt;css('bootstrap.min.css') ?&gt;
  
          &lt;!-- Optional theme --&gt;
      &lt;!--&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"&gt; --&gt;
      &lt;?= $this-&gt;Html-&gt;css('bootstrap-theme.min.css') ?&gt;
  
      &lt;!-- Not actually sure what this does --&gt;
      &lt;?= $this-&gt;fetch('css') ?&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;header&gt;
          &lt;div class="header-title"&gt;
              &lt;span&gt;&lt;?= $this-&gt;fetch('title') ?&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="header-help"&gt;
              &lt;span&gt;&lt;a target="_blank" href="http://book.cakephp.org/3.0/"&gt;Documentation&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a target="_blank" href="http://api.cakephp.org/3.0/"&gt;API&lt;/a&gt;&lt;/span&gt;
          &lt;/div&gt;
      &lt;/header&gt;
  
      &lt;div id='.jumbotron'&gt;
      Testing both bootstrap and default.ctp to see if this shows
      &lt;/div&gt;
  
      &lt;div id="container"&gt;
  
          &lt;div id="content"&gt;
              &lt;?= $this-&gt;Flash-&gt;render() ?&gt;
  
              &lt;div class="row"&gt;
                  &lt;?= $this-&gt;fetch('content') ?&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;footer&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
  
             &lt;!-- Latest compiled and minified Bootstrap JavaScript --&gt;
      &lt;!-- &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt; --&gt;
      &lt;?= $this-&gt;Html-&gt;script('bootstrap.min.js'); ?&gt;
  
      &lt;!-- Bootstrap requires jQuery to run bootstrap.js--&gt;
      &lt;?= $this-&gt;Html-&gt;script('jquery-1.11.3.min.js'); ?&gt;
  
      &lt;!-- Not actually sure what this does --&gt;
      &lt;?= $this-&gt;fetch('script') ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and the html source I see when I visit <a href="http://localhost:8765/" rel="nofollow noreferrer">http://localhost:8765/</a>:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;
          CakePHP: the rapid development php framework    &lt;/title&gt;
      &lt;link href="/favicon.ico" type="image/x-icon" rel="icon"/&gt;&lt;link href="/favicon.ico" type="image/x-icon" rel="shortcut icon"/&gt;    &lt;link rel="stylesheet" href="/css/base.css"/&gt;    &lt;link rel="stylesheet" href="/css/cake.css"/&gt;&lt;/head&gt;
  &lt;body class="home"&gt;
      &lt;header&gt;
          &lt;div class="header-image"&gt;
              &lt;img src="http://cakephp.org/img/cake-logo.png" alt=""/&gt;            &lt;h1&gt;Get the Ovens Ready&lt;/h1&gt;
          &lt;/div&gt;
      &lt;/header&gt;
      &lt;div id="content"&gt;
                  &lt;p id="url-rewriting-warning" style="background-color:#e32; color:#fff;display:none"&gt;
              URL rewriting is not properly configured on your server.
              1) &lt;a target="_blank" href="http://book.cakephp.org/3.0/en/installation/url-rewriting.html" style="color:#fff;"&gt;Help me configure it&lt;/a&gt;
              2) &lt;a target="_blank" href="http://book.cakephp.org/3.0/en/development/configuration.html#general-configuration" style="color:#fff;"&gt;I don't / can't use URL rewriting&lt;/a&gt;
          &lt;/p&gt;
  
          &lt;div class="row"&gt;
              &lt;div class="columns large-5 platform checks"&gt;
                                      &lt;p class="success"&gt;Your version of PHP is 5.4.16 or higher.&lt;/p&gt;
  
                                      &lt;p class="success"&gt;Your version of PHP has the mbstring extension loaded.&lt;/p&gt;
  
                                      &lt;p class="success"&gt;Your version of PHP has the openssl extension loaded.&lt;/p&gt;
  
                                      &lt;p class="success"&gt;Your version of PHP has the intl extension loaded.&lt;/p&gt;
                              &lt;/div&gt;
              &lt;div class="columns large-6 filesystem checks"&gt;
                                      &lt;p class="success"&gt;Your tmp directory is writable.&lt;/p&gt;
  
                                      &lt;p class="success"&gt;Your logs directory is writable.&lt;/p&gt;
  
                                                      &lt;p class="success"&gt;The &lt;em&gt;FileEngine&lt;/em&gt; is being used for core caching. To change the config edit config/app.php&lt;/p&gt;
                              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="columns large-12  database checks"&gt;
                                                      &lt;p class="success"&gt;CakePHP is able to connect to the database.&lt;/p&gt;
                              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="columns large-6"&gt;
                  &lt;h3&gt;Editing this Page&lt;/h3&gt;
                  &lt;ul&gt;
                      &lt;li&gt;To change the content of this page, edit: src/Template/Pages/home.ctp.&lt;/li&gt;
                      &lt;li&gt;You can also add some CSS styles for your pages at: webroot/css/.&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
              &lt;div class="columns large-6"&gt;
                  &lt;h3&gt;Getting Started&lt;/h3&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a target="_blank" href="http://book.cakephp.org/3.0/en/"&gt;CakePHP 3.0 Docs&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a target="_blank" href="http://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/intro.html"&gt;The 15 min Bookmarker Tutorial&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a target="_blank" href="http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/blog.html"&gt;The 15 min Blog Tutorial&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
                  &lt;p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;hr/&gt;
          &lt;div class="row"&gt;
              &lt;div class="columns large-12"&gt;
                  &lt;h3 class=""&gt;More about Cake&lt;/h3&gt;
                  &lt;p&gt;
                      CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Front Controller and MVC.
                  &lt;/p&gt;
                  &lt;p&gt;
                      Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
                  &lt;/p&gt;
  
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="http://cakefoundation.org/"&gt;Cake Software Foundation&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;Promoting development related to CakePHP&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="http://www.cakephp.org"&gt;CakePHP&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;The Rapid Development Framework&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="http://book.cakephp.org/3.0/en/"&gt;CakePHP Documentation&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;Your Rapid Development Cookbook&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="http://api.cakephp.org/3.0/"&gt;CakePHP API&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;Quick Reference&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="http://bakery.cakephp.org"&gt;The Bakery&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;Everything CakePHP&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="http://plugins.cakephp.org"&gt;CakePHP plugins repo&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;A comprehensive list of all CakePHP plugins created by the community&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="https://groups.google.com/group/cake-php"&gt;CakePHP Google Group&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;Community mailing list&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="irc://irc.freenode.net/cakephp"&gt;irc.freenode.net #cakephp&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;Live chat about CakePHP&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="https://github.com/cakephp/"&gt;CakePHP Code&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;For the Development of CakePHP Git repository, Downloads&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="https://github.com/cakephp/cakephp/issues"&gt;CakePHP Issues&lt;/a&gt;
                      &lt;ul&gt;&lt;li&gt;CakePHP issues and pull requests&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;footer&gt;
      &lt;/footer&gt;
  &lt;script&gt;var __debug_kit_id = 'cade8b34-e4ea-4601-a30e-a3a941ddf855', __debug_kit_base_url = 'http://localhost:8765/';&lt;/script&gt;&lt;script src="/debug_kit/js/toolbar.js"&gt;&lt;/script&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>