How to pass data to layout file? I can only access the passed data on the content page but not on the layout file.
public function get_index($name){
return View::make('widget.'.$name)
->with("title", ucwords($name).' ‹ Document Management System');
}
Use
View::share('data', $data);
on your before
filter or in __construct
of your Base_Controller
.
You need a global view variable. I think you need to look at View::share('title', $title);
I also think you can chain it with ->shares('title', $title)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With