Re[2]: [SMARTY] Compile plugin

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re[2]: [SMARTY] Compile plugin
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3741@lists.php.net to get a copy of this message
Yes, now that I reread the docs on the compiler section I see it clearly says that. doh Also, thanks for pointing at the count modifier! /linus On Mon, 15 Apr 2002 16:43:33 +0200 Ivo Jansch <ivo@ibuildings.nl> wrote: > Hi, > > Linus McCabe wrote: > > > function smarty_compiler_count($params, &$smarty) > > > > afaik I'm doin it all correct? Seems to me as if the $params is > incorrectly > > not turned into an array. > > If I remember correctly, the params aren't passed to the compiler > function as an array, but as an $argument_string. You have to do this to > turn them into an array: > > funtion smarty_compiler_count($argumentstring, &$smarty) > { > $params = $smarty->_parse_attrs($argumentstring); > > // Now $params['var'] contains the parameter you need. > } > > But why bother with a compiler function for a simple thing like count()? > Wouldn't {$base_sections|count} accomplish the same? > > Greetings, > Ivo

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