Support the ongoing development of Laravel.io →
Database Views Blade
Last updated 2 years ago.
0

I guess the view should be dynamically generated while iterating an array? maybe use partial views? you can pass the object at the index to the partial view.

maybe something like:

controller- return vew with array

main view- foreach (array as element) include('partials/elementView', element)

partial view- table with rows and stuff for each element['key']

0

i owe you a beer. Everything's already in the 'parent' view so this is all that's needed in the partial_view.

@foreach ($field_names_array as $name)
	<?php echo($snippets_array[0].$record[$name].$snippets_array[1]);?>
@endforeach

i am a happy coder!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

stu3881 stu3881 Joined 22 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.