Layout Structure
There are 2 different layout template . public template ( index.blade.php ) and admin template ( main.blade.php ) .
All files location at : protected/app/views/layouts/
Both of layouts template almost having same structure , except admin template( main.blade.php ) having sidebar menu
Render content into public template
class YourController extends BaseController {
protected $layout = "layouts.index";
function yourFucntion ()
{
$data = array( );
$this->layout->nest('content','folder.yourtemplate','$data')
}
}
Render content into Admin template
class YourController extends BaseController {
protected $layout = "layouts.main";
function yourFucntion ()
{
$data = array( );
$this->layout->nest('content','folder.yourtemplate','$data')
}
}
Using 2 template inside one controller
class YourController extends BaseController {
/* Default layout */
protected $layout = "layouts.main";
function yourFunction ()
{
$data = array( );
$this->layout->nest('content','folder.yourtemplate','$data');
}
function yourFunction ()
{
// Change template to public template
$this->layout = View::make('layouts.index');
$data = array( );
$this->layout->nest('content','folder.yourtemplate','$data')
}
}