I'll try to do that this week. It's been on my list for a while. Maybe Thursday or Friday.
Really Need Advanced Blade Templating Lesson
The laravel Docs are very poor in this area. I am wanting to create pages made up 4++ interchangeable layers so that I do not have to repeat a whole bunch of HTML.
The docs only tell you how to do the simplest of pages, as does the existing Laracasts videos.
I would really like to see a full and detailed explanation of the differences between show, include, stop, yield, section etc etc
quite frustrating ..
Brilliant ! Thanks so much !
Just figured something out about Blade - layers work upside down, from the bottom up not the top down ...
Really looking froward to that advanced Blade lesson
thanks !
Looking forward to this +1
layers work upside down, from the bottom up not the top down
@vincej What do you mean with that?
I am putting together pages which have 3-4 layers to them, a little bit like layers in photoshop.
When I wrote that post, I was under the belief that L4 renders these layers bottom up, not top down. Now I am not too sure.
I am pretty sure everything gets read top to bottom...?
If you talk about many layers, do you mean something like this, where I nested 3/4 layers:
// /templates/items/create.blade.php
{!! Form::open(array('route' => 'app.items.create', 'class' => 'form')) !!}
@include('partials.forms.item')
<div class="form-group">
{!! Form::submit('Create item', array('class'=>'btn btn-primary')) !!}
</div>
{!! Form::close() !!}
// /templates/partials/forms/item.blade.php
<div class="form-group">
{!! Form::label('date', 'Item date', ['class' => 'control-label']) !!}
{!! Form::text('date', null, array( 'class'=>'form-control', 'placeholder'=>'yyyy-mm-dd')) !!}
</div>
// more fields..
@include('partials.forms.subitem')
// /templates/partials/forms/subitem.blade.php
<div class="form-group">
{!! Form::label('Subitem name') !!}
{!! Form::text('subitemname', null, array( 'class'=>'form-control' )) !!}
</div>
// more fields..
@include('partials.forms.subsubitem')
// /templates/partials/forms/subsubitem.blade.php
<div class="form-group">
{!! Form::label('Subsubitem name') !!}
{!! Form::text('subsubitemname', null, array( 'class'=>'form-control' )) !!}
</div>
Disclaimer -- I'm quite a n00b -- I came to start a new project and realised how little I knew about iterating through multi-dimensional arrays to build an indented recursive parent-child menu. Working with blade and partials, and helper functions to output very bootstrap'ish HTML has gotten my code so messy so fast -- I don't mean to hijack Vinces' thread, but if an advanced Blade video worked in something that could be real-world useful, like a recursive menu structure, I know I, for one certainly benefit a great deal.
Heah Jeffrey, Are you getting closer to producing this lesson ?
I'm also interested in the best way to loop over multi dimensional array and present the variables in a table.
Checkout this video: https://laracasts.com/series/laravel-5-fundamentals/episodes/13
It is geared towards L5 and gives you some of the things that changed in version 5.
You may also want to watch these: https://laracasts.com/series/laravel-5-fundamentals/episodes/5 https://laracasts.com/series/laravel-from-scratch/episodes/6 https://laracasts.com/series/laravel-from-scratch/episodes/7
Otherwise if there are any specific issues you are having post here and I will try and put together a sample to help you out on Friday (tomorrow/today since it is after midnight here!).
Many Thanks @akael. I'll give them a look. @jeffreyway has been promising an advanced Blade lesson for a couple of weeks now.
Please or to participate in this conversation.