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.
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.
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 )
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community