i have a routine which generates this code:
<td style="text-align:left">
{{ Form::label("record_type","record_type") }}
</td>
<td style="text-align:left">
{{ Form::text('record_type',$data_array_name['record_type']) }}
</td>
</tr>
<tr>
<td style="text-align:left">
{{ Form::label("name","name") }}
</td>
<td style="text-align:left">
{{ Form::text('name',$data_array_name['name']) }}
</td>
and saves it as a file which i include in my read loop inside the view
@include("...'browse_select_display_snippet')
is there any way, i can pass it directy to the view instead of having to create the file and reference it? thanks
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']
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!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community