【发布时间】:2015-08-10 11:20:41
【问题描述】:
我试图先包含 header.blade.php,然后再包含内容,但它包含错误的方式。
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<!-- include navbar / header -->
@include('site.components.header')
<!-- content -->
@yield('content')
<!-- footer -->
@include('site.components.footer')
</body>
</html>
渲染后,在 HTML 中的内容首先被包含,然后是标题。
【问题讨论】:
-
删除你的html标签。laravel.com/docs/5.0/templates
-
您的其他页面中是否有带有
@stop的@section内容? -
@Isahas 为什么要删除 html 标签?
-
谢谢!我的内容部分没有@stop。