Welcome Guest, Not a member yet? Register   Sign In
looping through entire multidimensional array passed to view
#5

[eluser]jordantkj[/eluser]
Thanks for the responses. The problem is that I'm passing the whole array to view and for whatever reason, I cannot access the data the same as when I'm in a controller or model. The documentation states this. When the array is passed to view, the internal array names ie. 'fpc1' become variables and the top level array 'router_array' cannot be referenced. So the solution would involve looping through all the array data while in view.

I can access individual sub-arrays using the following code, but if I have multiple sub-arrays with varying names, its impractical. I'm hoping someone might have run into this problem and figured out a simple trick to get it to work.

Code:
foreach($fpc1 as $att1) {
  echo '<td>' . $att1 . '</td>';
}

-T


Messages In This Thread
looping through entire multidimensional array passed to view - by El Forum - 01-30-2012, 10:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB