Blade template output c by default enables

Is it possible to switch to a different view, but then by default with an include clause?

Example:

@yield('header', @include('partials.header'))

The supposed action is that if the subview does not include a title, then the current template will include the partials.header view.

+4
source share
1 answer

It is possible. But you cannot use knife marks inside tags. However, you can use View::make()instead @include. @includeactually compiles to a call makein the factory view.

@yield('header', View::make('partials.header'))
+10
source

Source: https://habr.com/ru/post/1570790/


All Articles