mercredi 25 mai 2016

Can you do more than iterate through an array in Laravel Blades?

I have passed an array ($players) to my view, and I can easily iterate over it using @foreach within the blade, but what I am actually trying to do is check the entire array for a certain players name, then output all of his data in the blade. I plan on doing this using a dialog box. This would be all well and good if I was using a search feature, or something like that, but I am trying to just use jQuery-UI's Dialog() and some Javascript. Whenever a players name is hovered over, I'd like to run that query and display his stats.

Is it possible to search through an array in such a way in blade templating? I figure I can just compact all of the players into their own array and then pass it to the view, but this seems like too much work (in the sense that I feel this can be more automated). As of now, it's only 17 players, but I'd like this to work if it was 100 players.

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1XyuF5r
via IFTTT

Aucun commentaire:

Enregistrer un commentaire