Re: [SMARTY] How to type out this array in smarty template?

From: Date: Tue, 25 Feb 2003 09:41:31 +0000
Subject: Re: [SMARTY] How to type out this array in smarty template?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8174@lists.php.net to get a copy of this message
Hi, Konference wrote:
Is there some solution how to type out this array in smarty template??
Yes. $smarty->assign("data", $yourarray); and then in the template something like: {section name=i loop=$data}
    <BR>Name: {$data[i].name}
    <BR>Id: {$data[i].id}
    <BR>Sub:
     {section name=j loop=$data[i].sub}
        <BR>- Name: $data[i].sub[j].name
        <BR>- Id: $data[i].sub[j].id
     {/section}
{/section} It's easier with a foreach probably, but I haven't got enough experience with foreach to explain that method to you. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl

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