Re: Arguments for Smarty!

From: Date: Wed, 19 Dec 2001 10:46:49 +0000
Subject: Re: Arguments for Smarty!
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2338@lists.php.net to get a copy of this message
Hi, Andreas Heintze wrote:
About the loops in Smarty, the foreach is a good and easier alternative to sections when it comes to single arrays. Can multidim.arrays be done easier somehow??
This can also be done with foreach: // multidimensional array with cells of a 2x3 table $mda = array(0 => array(5, 10, 99), 1 => array(143,2,0)); <table> {foreach item=row from=$mda}
    <tr>
     {foreach item=col from=$row}
       <td>{$col}</td>
      {/foreach}
    </tr>
{/foreach} </table> Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl

« previous php.smarty.general (#2338) next »