PDA

View Full Version : Access Nested Arrays in Templates


fifers
08-03-2005, 11:47 AM
Hello,

I am working on a way to display the complete Forum heirarchy in the search results and have it mostly working (vb3.0.8). My last problem is that my data is in an array and I need to index it via another array (in a template):


<td>$forum_links[$thread['forumid']]</td>


I want the modification to not alter PHP files but I think that I might have to if there is no way to index into an array using another array value. Does anybody have any suggestions? If I can't get it to work I'll move it into the search.php file and modify the $thread and $post variables but I'd rather keep it in phpinclude_start.

I'll post the code as soon as I have something working!

Cheers,

Ryan

Andreas
08-03-2005, 12:07 PM
You should avoid nested arrays in Templates.
However, if it absolutely necessary:


<td>{$forum_links["$thread[forumid]"]}</td>

fifers
08-03-2005, 12:35 PM
Perfect. Thanks!