Welcome Guest, Not a member yet? Register   Sign In
Not able to pass data to a view
#11

[eluser]techgnome[/eluser]
Ok... starting to make some sense I think... directory_map returns an array of array of array (and so on, on down the path structure.) Since some of the values are an array, you can't simply echo it out. I suspect that's what is going on. Unfortunately I'm out of ideas on how to get around that. The PHP manual wasn't much help and their array of array was a contrived example.

You might need to create a recursive function that takes an array as an input. While looping through the elements of the array, if the value itself is also an array, it calls the function, passing in that array... and so on.

Ah ha! All I needed to do was scroll down far enough on the foreach page.... and there's an example of what I mean:
Code:
<?php
   /* Grab any values from a multidimensional array using infinite recursion.  --Kris */
   function RecurseArray( $inarray, $toarray )
   {
       foreach ( $inarray as $inkey => $inval )
       {
           if ( is_array( $inval ) )
           {
               $toarray = $this->RecurseArray( $inval, $toarray );
           }
           else
           {
               $toarray[] = $inval;
           }
       }
      
       return $toarray;
   }
?>
Here's the link: http://us.php.net/manual/en/control-stru...oreach.php
And to the specific user comment where I got that: http://us.php.net/manual/en/control-stru....php#98335

Instead of returning a value, you could probably have it write out the dd dt lines for you... tinker around with it.

-tg




Theme © iAndrew 2016 - Forum software by © MyBB