如何在Laravel中为所有页面带来相同的布局

时间:2018-10-24 09:36:22

标签: php laravel

我想问一下如何在laravel中制作具有相同布局的所有页面。我尝试通过遵循Google的一些教程来做到这一点。它带来布局,但在标题顶部显示内容,如果我添加@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');
});

1 个答案:

答案 0 :(得分:1)

使用@stop代替@endsection

@extends('admin.layout')
@section('content')
i am the home page
@stop