Does Smarty support assigning multidimensional arrays? I've tried to get
it working, but just can't get it.
can someone help me?
this is what I have in my php file:
$side_bar =
array('link' => array( 'index.php',
'estate.php',
'text' => array( 'Home',
'Real Estate')));
$smarty->assign ("side_bar", $side_bar);
then in my template file I have this:
{section name=i loop=$side_bar}
<tr><td width="19"><img src="images/td_background_left.gif" width="19"
height="22" alt="" border="0"></td>
<td align="left" valign="center" height="22" width="118"
background="images/td_background_right.gif">
<p><span style="font-family: Arial; color:black; font-size: 8pt;">
{if $side_bar.link.i neq ""}
<a href= {$side_bar.link.i} style="text-decoration:none; color:black;">
<b>& {$side_bar.text.i}</b></a></span></p></td></tr>
{else}
<a><b>&{$side_bar.text.i}</b></a></span></p></td></tr>
{/if}
{/section}
with this code, only one row is produced in the table. I guess it's
because $side_bar only has two values which have more values beneath
them. How can I create a side bar that will have the link and then text
that I store in the array? Does it work to have an Associative array
mixed with an Indexed array, and then display the indexed array the way
I tried?
Obviously it does not work like this. I'm fairly new to PHP and Smarty,
so if anyone has suggestions on how I can get this done, please tell me.
Thanks,
Mark