Laravel模板 - 将数据传递给布局

Ram*_*iao 4 php laravel

如何将数据传递给布局文件?我只能访问内容页面上传递的数据,但不能访问布局文件.

public function get_index($name){
    return View::make('widget.'.$name)
            ->with("title", ucwords($name).' ‹ Document Management System');
}
Run Code Online (Sandbox Code Playgroud)

Muh*_*man 7

使用

View::share('data', $data);
Run Code Online (Sandbox Code Playgroud)

在你的before过滤器或在__construct您的Base_Controller.