mardi 15 décembre 2015

Blade: how to include a section in one page but not in another

I have a report that I present on screen.

report.blade.php

<html>
    <head>
    </head>
    <body>
        @yield('content')
    </body>
</html>

report_sub1.blade.php

@extends('reports.report')

@section('content')
    <h1> This is sub section 1 </h1>

    <h1> This is sub section 2 </h1>
@stop

I want to include the section 2 in the 1st report but not in the second. Meaning I have two identical reports, but the one should not print section 2.

How can you do that?

Okay, a step closer, but for some reason I get the following message. the files are in the same folder. and I use a simple

@include('extra_section')

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire