一个收益率正在发挥作用,而其他收益率则没有

时间:2015-07-24 03:04:22

标签: laravel blade

我正在尝试生成标题页以及内容页面。我的路线是这样的:

Route::get('projects/create', 'ProjectsController@create');
Route::get('/', function()
 {
    return view('pages.home');
 });

查看> master.blade.php:

# Basic HTML stuff and <head></head>

<body>
    @yield('header')

    <div class="container text-center">
        @yield('content')
    </div>
</body>

页&GT;视图&gt;项目与GT; Create.blade.php:

@extends('master')

@section('content')
  working
@stop

页&gt;查看&GT;网页和GT; Header.blade.php:     @extends(&#39;主&#39)

@section('header')

 <nav class="navbar navbar-inverse fixed-top">
  <div class="container-fluid">
    <div class="navbar-header">
       <a class="navbar-brand" href="/pages/home">
         ...
 @if(Auth::user())
    ...
 @endif
 @stop

当我用@yield(&#39;标题&#39;)部分替换整个标题代码时,它可以完美地运行。你有什么线索吗?

1 个答案:

答案 0 :(得分:2)

如果您已升级到laravel 5.1 ..您可能想要为您的刀片模板试用@section- @endsection

http://laravel.com/docs/5.1/blade

相关问题