In most cases, we want to have multiple lines by default, we can use this syntax:
@section('section') Default content @show
For example, I have this in a template file:
@section('customlayout') <article class="content"> @yield('content') </article> @show
You can see the difference between @show and @ stop / @ endsection: the above code is equivalent to the one below:
@section('customlayout') <article class="content"> @yield('content') </article> @stop @yield('customlayout')
In other view files, I can either install only the content:
@section('content') <p>Welcome</p> @stop
Or I can also set another layout:
@section('content') <p>Welcome</p> @stop @section('defaultlayout') <div> @yield('content') </div> @stop
@stop is equivalent to @endsection.
Zoltan Laszlo Ferenci
source share