我的Blade模板内容显示两次

时间:2017-02-22 07:25:56

标签: php laravel-5 laravel-blade

我是laravel的新手。当我尝试制作主布局示例时,我会将我的视图内容打印出来两次。

master.blade.php:

    <html>
    <head>
        <title>@yield('title')</title>
    </head>
    <body>
        @section('sidebar')
            This is the master sidebar.
        @show

        <div class="container">
            @yield('content')
        </div>
    </body>
</html>

page.blade.php:

@extends('layouts.master')

@section('title', 'Page Title')

@section('sidebar')


    <p>This is appended to the master sidebar.</p>
@endsection

@section('content')
    <p>This is my body content.</p>
@endsection

和我的路线web.php:

Route::get('blade', function () {
    return view('page');
});

我尝试使用@endsection的@stop intead,但它没有用。

0 个答案:

没有答案
相关问题