大家好,我想加载shopReq.blade.php
文件在master.blade.php
,我成功地做到了这一点。但是当我加载modals.blade.php
文件在shopReq.blade.php
它不包括在内。我在这里做错了什么?请帮忙。@yield,@laction在Laravel
master.blade.php(在视图/布局):
<html>
<body >
@yield('content')
</body>
</html>
shopReq.blade.php(在视图中)
@extends('layouts.master')
@section('content')
<h1>Hello I am in shopReq.blade.php
@yield(content)
@endsection
modals.blade.php(在视图中)
@extends('shopReq')
@section('content')
<h1>Hello I am in modals.blade.php
@endsection
web.php:
Route::group(['middleware' =>['web']], function()
{
Route::get('/', function() {
return view('welcome');
})->name('home');
});
您是否收到任何错误? –
@ B.Desai No.没有错误。我想'modals.blade.php'在'shopReq.blade.php'上。但我这样做没有成功。 –
哪个'view'你最终打电话?在你的问题添加路线和查看调用代码。你在这种情况下添加了'welcome'视图代码,而不是实际的问题代码 –