Re: [SMARTY] recursive template

From: Date: Thu, 20 Mar 2003 17:38:01 +0000
Subject: Re: [SMARTY] recursive template
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8783@lists.php.net to get a copy of this message
Think this his exactly you need, or I don't understand what you wnat {section name=numloopparent loop=$yourarray} .... // I don't know if loop=$yourarray[numloopparent].children work // You can try loop=$yourarray[numloopparent].children // Or assign child array before section {assign var=childarray value=$yourarray[numloopparent].children} and use childarray in section {section name=numloopchildren loop=$yourarray[numloopparent].children} ..... {/section} {/section} Le jeu 20/03/2003 à 17:03, Eaden McKee a écrit : > > > > > >>How would I do this with smarty? I would like to do it with 3 smarty > >>tags with one as the begining, one where the children go, and one for > >>the end, and I don't want to recursivly include templates. > >> > >> > > > >I hope this help: > > >>http://smarty.php.net/manual/en/language.function.section.php > >Example 7-18. nested sections > > > > > no, because it requires putting template tags in for every level of > section .the idea is that the array has unlimited children of unknown > level. > I'm really looking for _recursive_ sections, which are like nested > sections, but unlimited in depth, and the depth is unknown. > > I want tags like : > > {{ section }} > > {{ section children }} > > {{ / section }} > > where if there are any children, it runs section again. and so on and so > on. Like the php function I posted, notice it calls itself. > > Eaden -- Jean-Michel Juzan jmjuzan@ecreasol.ch Direction Informations & Technologies eCreaSol - NetWork Creative Solutions SARL - http://www.ecreasol.ch/ PGP public keys server : http://www.keyserver.net

Attachment: [application/pgp-signature] signature.asc
« previous php.smarty.general (#8783) next »