title: Laravel without Blade - Controllers and Views
body: <p>I am more efficient at setting up my view logic with straight up php. Blade is cool but it's not for me. I am trying to translate all the Blade specific examples and docs to just php. I don't like the fact that I need to assign all the variables for my views in an array of View::make(). I did found all of this so far.</p>
  
  <p>controllers/home.php:</p>
  
  <pre><code>class Home_Controller extends Base_Controller {
  
      public $layout = 'layouts.default';
  
      public function action_index()
      {
          $this-&gt;layout-&gt;name = 'James';
          $this-&gt;layout-&gt;nest('content', 'home.index');
      }
  
  }
  </code></pre>
  
  <p>views/layouts/default.php:</p>
  
  <pre><code>// head code
  &lt;?php echo Section::yield('content') ?&gt;
  // footer code
  </code></pre>
  
  <p>views/home/index.php</p>
  
  <pre><code>&lt;?php Section::start('content'); ?&gt;
  &lt;?php echo $name ?&gt;
  &lt;?php Section::stop(); ?&gt;
  </code></pre>
  
  <p>I am greeted with this error: <code>Error rendering view: [home.index] Undefined variable: name</code>. I know that <code>$this-&gt;layout-&gt;nest('content', 'home.index', array('name' =&gt; 'James'));</code> works but that negates my point about having to send all my variables to an array. This can't be the only way.</p>
  
  <p>The view templating docs doesn't seem to touch on doing variables with nested views from controllers.</p>