Re: counter as a variable

From: Date: Sat, 24 Nov 2001 22:26:44 +0000
Subject: Re: counter as a variable
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2038@lists.php.net to get a copy of this message
Thanks Monte :) From: Monte Ohrt [mailto:monte@ispi.net] >Maybe we could add a new attribute to counter: >{counter assign="varname"} >{$varname} Great idea. (math equation ="x + y" assign="varname"} would be also very useful. > this is currently one workaround: > {capture name="varname"}{counter}{/capture} > {$smarty.capture.varname} It works! :) However,I thought this should work. But it doesn't: {counter start=1} {capture name="cell"}{counter}{/capture} {assign var="picnumber" value=$smarty.capture.cell} {$images_name[picnumber]} There is no output for {$images_sr[picnumber]} eventhough there is a proper array for $images_name. any thoughts? Thanks Jorge

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