Re: [SMARTY] Block function
| From: | Haber Janos | Date: | Sun, 23 Mar 2003 15:47:39 +0000 |
| Subject: | Re: [SMARTY] Block function | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8849@lists.php.net to get a copy of this message | ||
Hi!
> {section name=count loop=$var}
> // you have iteration or loop or ... in the doc
> {if $smarty.section.count.iteration<15}
> <DIV ALIGN="{$var[count].align}">{$var[count].text}</DIV>
> {/if}
> {/section}
I know that, but I want this into own function not in the template.
example:
function smarty_block_repeat($params,$content,&$smarty)
{
for(i=0;i<15;i++)
{
$var["align"]="CENTER";
$var["text"]="The counter is ".$i;
$this->assign("var",$var);
//And here evaulate expression
eval($content);
}
}
Cow