Closed sohelrana820 closed 7 years ago
Yes possible. In your view you can pass a variable with the view name like
@extends($view)
here $view
is a variable which stored the view name from controller my controller looks following
$view = 'profile_layout';
return view('someview', compact('view'));
It's applicable for current theme.
If you want to specific theme layout then:
$view = 'your_theme_name::profile_layout';
return view('someview', compact('view'));
OK, I understand. But there suppose to need to pass layout_name from every controller to view. Do you think it would be easier to use?
Use view composer.
Suppose, one theme has 2/3 deferent layouts (app_ayout.blead.php, profile_layout_blade.php etc). And want to switch layout on runtime. Is there anything there. Just similar like CakePHP (https://book.cakephp.org/3.0/en/views.html)