Welcome Guest, Not a member yet? Register   Sign In
problem passing an array to a view
#1

[eluser]lord_nerevar[/eluser]
Hi all.

in the controller i have $list that is an array with numeric index, and every field is an array too.

for example $list[$i]['name'] in the controller give me the correct field.

I want to print data in the view instead of the controller, but when i pass $list to a view, as explained in the guide, how can i access to the field with a loop? I had to print all the 'name' field of that array but i can't!
#2

[eluser]theprodigy[/eluser]
The array being passed from the controller to the view needs to be an associative array, not numerically indexed.
#3

[eluser]lord_nerevar[/eluser]
So i am obliged to "insert" the view in the controller.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB