问题描述
<body>
@include('layouts.header')
@yield('content')
@include('layouts.footer')
@include('layouts.footer-script')
</body>
@extends('layouts.master')
// I would like to add Menu here
@section('content')
//more code here
@endsection
我的 menu.blade.PHP
如下所示。
@extends('dashboard')
@section('menu')
// more HTML code
@endsection
如何在 Menu
中添加 dashboard.blade.PHP
?
解决方法
dashboard.blade.php
文件如下
@extends('layouts.master')
@include('menu')
@section('content')
//more code here
@endsection
menu.blade.php
如下所示。
<div>
// more HTML code
</div>
,
如果您的菜单是静态的,只需将其用作包含
仪表盘文件
@extends('layouts.master')
@section('content')
@include('layouts.menu')
@endsection
和菜单文件将是 (menu.blade.php)
<a href=''>Home</a>
,
master.blade.php
<body>
@include('layouts.header')
@yield('content')
@include('layouts.footer')
@include('layouts.footer-script')
</body>
dashboard.blade.php
@extends('layouts.master')
@include('menu')
@section('content')
//more code here
@endsection
这是您的代码。 这很好。 如果这是错误,我认为menu.blade.php的路径一定是错误的。
例如:@include(frontend.menu)
感谢您的回答。