Support the ongoing development of Laravel.io →
Views Blade
Last updated 1 year ago.
0

I was thinking what I could do is load is extend something like @extends('layout.users') and include the information at the top but the OCD in me wants to leave extend the same for every file.

Last updated 1 year ago.
0

Ok so this is the solution that I thought of I extend a different page for each blade but the layout that is being called just contains.

@include( 'includes.default' )

Page

@include( 'includes.default_end' )

This lets me get around putting specific html in my footer and header files since I know that I will have 10% of my pages that need some different layout. Looking for some feedback still to see if others who have been using blade/laravel longer think this is a sane solution.

Last updated 1 year ago.
0
Solution

you can extend multiple sections and even overwriting them. there is also a @parent tag that allows you to append / prepend to the existing content.

aside from all this you can use variables

@extend( $MyVarThatWasSetInMyController )
Last updated 1 year ago.
0

zenry said:

you can extend multiple sections and even overwriting them. there is also a tag that allows you to append / prepend to the existing content.

aside from all this you can use variables

@extend( $MyVarThatWasSetInMyController )

Awesome, I was originally trying to stay away from in the page it should load through the controller. But that is what it is there for so... anyway I did what you said and I like it a lot more than my prior solution. Thanks for the help! Still getting use to blade and being able to use variables without php tags.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.