two ways to use it
#1 use blade on controller
in controller, you need to assign a template for controller.
1 | protected $layout = 'layouts.master'; |
and then in each function action. assign whatever need to assign for show content on template. like in blade template. I have a content section. Therefore, i need to set a value or view to 「Content」
1 | $this->layout->content = something or View::make('something'); |
in blade template. there are 2 ways to define var.
-
@yield(『something』)
if use first method; then in view, it needs to create a section something. ex
1 | @section('content') |
for method 2. no need to create a section to contain page content.