如果@yield有没有内容,是否可以查看Blade 视图?
I am trying to assign the page titles in the views:
@section("title", "hi world")
所以我想登记一下主布局视图.类似于:
<title> Sitename.com {{ @yield('title') ? ' - '.@yield('title') : '' }} </title>
如果@yield有没有内容,是否可以查看Blade 视图?
I am trying to assign the page titles in the views:
@section("title", "hi world")
所以我想登记一下主布局视图.类似于:
<title> Sitename.com {{ @yield('title') ? ' - '.@yield('title') : '' }} </title>
也许有一种更漂亮的方法可以做到这一点.但这确实起到了作用.
@if (trim($__env->yieldContent('title')))
<h1>@yield('title')</h1>
@endif