senty
senty

Reputation: 12847

One yield is working while other doesn't

I am trying to yield header page as well as the content page. My routes are like this:

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

View>master.blade.php :

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

<body>
    @yield('header')

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

Pages>View>Projects>Create.blade.php:

@extends('master')

@section('content')
  working
@stop

Pages>View>Pages>Header.blade.php: @extends('master')

@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

When I replace the whole header code with the @yield('header') section, it works perfectly. Do you have any clue?

Upvotes: 1

Views: 764

Answers (1)

MrPandav
MrPandav

Reputation: 1861

If you have upgraded to laravel 5.1 ..you might want to try @section- @endsection for your blade template

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

Upvotes: 2

Related Questions