Template Lite Multidimensional Array
Posted: Tue Nov 21, 2006 10:44 am
Given the following array, I'm having hard times trying to figuring out how could I do to read its values from the template...
And now, inside the template, I've to loop in the array
I think one of the best ways to pass data to the template is through a multidim array, but I'm a little bit dissapointed how different is looping arrays in TL from a PHP point of view 
Is there any TL gurú in this forum?
Code: Select all
$T_array = below is the print_r'ed array
Array
(
[0] => Array
(
[link] => ?CALLED_FROM=3&VAL_1=1
[cat] => Categoria 1
[arr_subcat] => Array
(
[0] => Array
(
[link] => ?CALLED_FROM=CALLED_FROM_VER_SUBCATEGORIA&VAL_1=1
[subcat] => SUb 1
)
[1] => Array
(
[link] => ?CALLED_FROM=CALLED_FROM_VER_SUBCATEGORIA&VAL_1=2
[subcat] => Sub categoria 2
)
)
)
[1] => Array
(
[link] => ?CALLED_FROM=3&VAL_1=3
[cat] => Interés general
[arr_subcat] => Array
(
)
)
[2] => Array
(
[link] => ?CALLED_FROM=3&VAL_1=2
[cat] => Programacion
[arr_subcat] => Array
(
[0] => Array
(
[link] => ?CALLED_FROM=CALLED_FROM_VER_SUBCATEGORIA&VAL_1=3
[subcat] => Otra Subcategorias
)
)
)
)
///asign the var to the template
$tpl->assign('T_array', $T_array);Code: Select all
{section name=id loop=$T_array}
link: {$T_array[id].$link} {* It doesn't work *} <br />
link: {$T_array[id].link} {* It doesn't work *} <br />
link: {$T_array[id][$link]} {* It doesn't work *} <br />
link: {$T_array[id][link]} {* It doesn't work *} <br />
{/section}Is there any TL gurú in this forum?