php - 如何为laravel中的所有页面带来相同的布局
问题描述
我想问一下如何在 laravel 中使所有页面都具有相同的布局。我尝试按照谷歌的一些教程来做到这一点。它带来布局,但在标题顶部显示内容,如果我添加@endsection
它隐藏内容。我希望任何人都可以帮助我解决问题。
下面我附上代码。
布局
<html>
<head></head>
<body>
@include('admin.header.header')
@include('admin.sidebar.sidebar')
<section id="container" class="">
@yield('content')
</section>
</body>
</body>
内容页面(会员)
@extends('admin.layout')
@section('content')
i am the home page
@endsection
路线
Route::get('/member', function () {
return view('member');
});
解决方案
使用@stop 代替@endsection
@extends('admin.layout')
@section('content')
i am the home page
@stop
推荐阅读
- c# - Deedle的速记创造新系列定长
- flutter - 如何将颤振模块导入颤振项目?
- notepad++ - Notepad++ 以一定间隔删除行(例如,使用 Skip 和 Take)
- git - 强制推送后如何取回已删除的文件
- c++ - boost::program_options 在 Klocwork 中生成 MLK.MUST
- spring-boot - h2 中的序列生成器不提供唯一值
- java - 1.7 中的 Java 函数(转换 lambda 表达式)
- java - 获取 JSONArray 的子节点
- c# - 使用 AgilityHTMLPack 抑制 HTML 中的标签
- oracle11g - 如何回滚 Oracle DB 中的所有提交