Re: loop

From: Date: Wed, 28 Mar 2001 16:59:13 +0000
Subject: Re: loop
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-481@lists.php.net to get a copy of this message
On Wed, 28 Mar 2001, Ivo Jansch wrote: > Is there an existing situation which would be broken by the change I > made? Otherwise this might be a useful fix to Smarty for other people > too. Yes, this will break stuff. The solution is not as obvious as you expect. :) > I also added a line to _compile_include_tag: > > " extract(\$include_vars);\n" . > " extract(\$include_vars['default']);\n" . // ivo hack > " include \"\$file_name.php\";\n" . > > I did this to cope with the previously discussed nested templates > problem. The nested infinite loop has been fixed in 1.3.2. > With this hack, I'm able to do the following: > > {section name=mysection loop=$yourbookmarks} > {include file="item.tpl" default=$mysection/yourbookmarks} > {/section} > > and then have an item.tpl which uses {$url} instead of {$default.url}. > (makes life easier for the template editor). What do you use 'default' for here? -Andrei * "UNIX, isn't that some archaic form of DOS?" - our job applicant *

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