Blade template not displaying a section

I have these three click patterns

In my controller, I call up the control panel as follows:

View::make('layouts.dashboard');

master.blade.php

<?= stylesheet_link_tag() ?>
<?= javascript_include_tag() ?>

<html>
<body class="fixed">

    <div class="wrapper">
        <div class="leftside">
            @yield('leftside', 'left-side content')
        </div>
        <div class="rightside">
            @yield('rightside', 'right-side content')       
        </div>   
    </div>

</body>

dashboard.blade.php

@extends('layouts.master')

@section('leftside')
    @yield('sidebar', 'sidebar content')
@stop

sidebar.blade.php

@extends('layouts.dashboard')

@section('sidebar')
  aaa
@stop

The dasbhoard blade is correctly displayed in the main blade, but the side panel does not want to show . Does anyone know what I'm doing wrong?

Thanks so much for any help :)

+4
source share
2 answers

I don’t think you can use yield () on a clip template that is not being called.

Basically what you can do do master.blade.php in this

<html>
<body class="fixed">
    <div class="wrapper">
        <div class="leftside">
            @include('sidebar') {{-- This is sidebar.blade.php --}}
        </div>
        <div class="rightside">
            @include('dashboard') {{-- This is dashboard.blade.php --}}      
        </div>   
    </div>
</body>
</html>

, , dashboard.blade.php, blade-. master.blade sidebar.blade dashboard.blade

@extends('layouts.master')

{{-- You can define now the sections available on master.blade and dashbard.blade --}}
+1

OK , :)

View:: make ('layouts.dashboard') View:: make ('layouts.sidebar');

0

Source: https://habr.com/ru/post/1548365/


All Articles