How do I pass a variable to the layout using Laravel' Blade templating?

后端 未结 11 2119
猫巷女王i
猫巷女王i 2021-01-30 03:30

In Laravel 4, my controller uses a Blade layout:

class PagesController extends BaseController {
    protected $layout = \         


        
11条回答
  •  执念已碎
    2021-01-30 04:33

    I was able to solve that problem by adding this to my controller method:

        $title = 'My Title Here';
        View::share('title', $title);
    

    $this->layout->title = 'Home page'; did not work either.

提交回复
热议问题