Hey guys!
I am trying to make a little card layout, and each of these little cards has a pretty similar html structure, enough so that I figured blade might be able to help me out here. They need a header, an icon, a body, and a footer each, and I figured I could do all this easily with just doing:
@extends('cardlayout')
@section('header')
Invites
@stop
@section('body')
<a href="#">Click here to see the invites!</a>
@stop
@section('icon')
pr_thumbsup
@stop
However this interferes with the main part of the template I am using which has it's own body, header, footer, etc tags. Is there a better way I should be doing this? This currently is not working at all.
either you use variables inside the templates and i don't think this would help, or you make a new file for cardlayout let's call it MainCardLayout and inside it just put the main codes with referring for the sections inside, then you extend it inside your Cardlayout and inside the other templates/ so you just need to create a main Layout file so CardLayout could extend it and the others as well.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community