I've searched for this on internet alot, but wasnt able to find answers. I'm using Laravel 5 and I've little issue with blade templating as in my project I need sometime to do multiple extends and I need to pass all data from one layout to all master layouts "extends"
Nested page example :
@extends('layouts.full', ['var' => 'key'])
@section('page')
page content here
@stop
layouts/full.blade.php example
@extends('app', ['need to pass same data here too'])
@section('content')
@yield('page')
@stop
and app.blade.php is just main html stuff
And I wanted to ask is there possibility to pass same vars without setting global variable like?
@extends('layouts.full', $data = [])
I think this might help you : https://laravel.com/docs/5.2/blade#service-injection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With