title: How do I pass a variable to the layout using Laravel' Blade templating?
body: <p>In Laravel 4, my controller uses a Blade layout:</p>
  
  <pre class="lang-php prettyprint-override"><code>class PagesController extends BaseController {
      protected $layout = 'layouts.master';
  }
  </code></pre>
  
  <p>The master layout has outputs the variable title and then displays a view:</p>
  
  <pre><code>...
  &lt;title&gt;{{ $title }}&lt;/title&gt;
  ...
  @yield('content')
  ....
  </code></pre>
  
  <p>However, in my controller I only appear to be able to pass variables to the subview, not the layout. For example, an action could be:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function index()
  {
      $this-&gt;layout-&gt;content = View::make('pages/index', array('title' =&gt; 'Home page'));
  }
  </code></pre>
  
  <p>This will only pass the <code>$title</code> variable to the content section of the view. How can I provide that variable to the whole view, or at the very least the master layout?</p>