Re: [SMARTY] Compile plugin
| From: | Ivo Jansch | Date: | Mon, 15 Apr 2002 14:43:33 +0000 |
| Subject: | Re: [SMARTY] Compile plugin | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3730@lists.php.net to get a copy of this message | ||
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 -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl