如何在 Laravel 中包含 view.blade.php 文件?
How to include a view.blade.php file in Laravel?
我在 views/content 中有此文件 sidebar.blade.php
,我想将此 (sidebar.blade.php
) 文件包含在我的视图中 home.blade.php
。
你看过docs了吗?
Blade's @include directive, allows you to easily include a Blade view
from within an existing view. All variables that are available to the
parent view will be made available to the included view:
@include('shared.errors')
Even though the included view will inherit all data available in the
parent view, you may also pass an array of extra data to the included
view:
@include('view.name', ['some' => 'data'])
我在 views/content 中有此文件 sidebar.blade.php
,我想将此 (sidebar.blade.php
) 文件包含在我的视图中 home.blade.php
。
你看过docs了吗?
Blade's @include directive, allows you to easily include a Blade view from within an existing view. All variables that are available to the parent view will be made available to the included view:
@include('shared.errors')
Even though the included view will inherit all data available in the parent view, you may also pass an array of extra data to the included view:
@include('view.name', ['some' => 'data'])