title: laravel 4 - How to load different layout for a particular method?
body: <p>I have something like this :</p>
  
  <pre><code>class AController extends BaseController
  {
    protected $layout = "templates.layouts.master";
    protected $data = "something";
  
    public function alt()
    {
      // this is wrong
      // i want to override "templates.layouts.master"
      // missing something obviously here
      $this-&gt;layout = ??? what should do?
      $this-&gt;layout-&gt;content = View::make("content", $this-&gt;data);
    }
  }
  </code></pre>
  
  <p>In method alt, I wish to use different layout than the default "templates.layouts.master". </p>
  
  <p>I have very limited laravel 4 knowledge. This maybe something easy to achieve, but is beyond my knowledge.</p>
  
  <p>Possible solutions that I forsee:</p>
  
  <ol>
  <li>define a construct method, and detect what is the current method, and set a different value for $layout (However, I not sure how to get the current method name).</li>
  <li>do an assignment like what I put in above.</li>
  </ol>
  
  <p>Which is the correct way?</p>