如何在Laravel的@yield
中使用@include
@include("layout.common.common-header",["title"=> @yield('title') ,"description"=>"description"])
答案 0 :(得分:0)
使用View::getSection('title')
获取@yield('title')
@include("layout.common.common-header",["title"=> View::getSection('title'),"description"=>"description"])
答案 1 :(得分:0)
请尝试一下
@include('layout.common.common-header',['title' => new Illuminate\Support\HtmlString($__env->yieldContent('title')) ,'description'=>'description'])