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

后端 未结 11 2029
猫巷女王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:15

    if you want to get the variables of sections you can pay like this:

    $_view      = new \View;
    $_sections  = $_view->getFacadeRoot()->getSections();
    dd($_sections);
    /*
    Out:
    array:1 [▼
      "title" => "Painel"
    ]
    */
    

提交回复
热议问题