在错误的地方包含 header Laravel 4
Including header in wrong place Laravel 4
我试图首先包括 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 中的内容,然后是 header。
当您创建一个可以包含某些内容的部分时,您还需要将其停止,例如:
@section('name of section here')
//Your customized content for this section.
@stop
虽然使用@show 会立即输出该内容,但它会结束当前部分并产生它。屈服意味着这是该部分内容将被输出的点。
@section('name of section here')
//Your customized content for this section.
@show
我试图首先包括 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 中的内容,然后是 header。
当您创建一个可以包含某些内容的部分时,您还需要将其停止,例如:
@section('name of section here')
//Your customized content for this section.
@stop
虽然使用@show 会立即输出该内容,但它会结束当前部分并产生它。屈服意味着这是该部分内容将被输出的点。
@section('name of section here')
//Your customized content for this section.
@show