Blade does not show section

I am following the laravel 5 tutorial from Jeffrey Paths on Laracasts.com, in clip 101 of videos Jeffrey writes a footer section which contains some Javascript, I tried to do the same but the "footer" section is not showing, only the content section , I tried to change names and nothing. Here's the code:

app.blade.php

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

    @yield('footer')
  </body>
</html>

      

contact.blade.php

@extends('app')

@section('content')
  <h1>Contact Me!</h1>
@stop

@section('footer')
  <script type="text/javascript">
    (function () {
      alert("Joder!");
    })();
  </script>
@stop

      

I tried using only text instead of Javascript and it is the same, the footer section is not displayed, also if I change "content" to "nothing" then the section also stops displaying.

Thank.

+3


source to share


1 answer


In app.blade.php replace

@yield('footer')

      

from



@section('footer')
@show

      

Then in your contact.blade.php replace the footer with

@section('footer')
    @parent

  <script type="text/javascript">
    (function () {
      alert("Joder!");
    })();
  </script>
@stop

      

+2


source







All Articles