Wednesday, April 1, 2015

Laravel Blade Recursive Partials with @each

In this tutorial, we’ll go through the process of implementing recursive partials in Laravel’s Blade templating engine by means of the @each command. This will allow us to render data structures with an arbitrary number of nested children without needing to know the maximum depth of the array.



The Data


The data I’m talking about is data like folder structures which can go deep into many levels. For our case, let’s imagine we’re dealing with a predefined data set of “Projects” in a todo application like Todoist. Feel free to grab the sample data from this gist or the code embed below:


Continue reading %Laravel Blade Recursive Partials with @each%




by Bruno Skvorc via SitePoint

No comments:

Post a Comment