|@count doesn't work anymore

0 views
Skip to first unread message

Karel S.

unread,
Dec 28, 2009, 5:10:31 AM12/28/09
to Smarty Developers
Latest svn build.

Fatal error: Uncaught exception 'Exception' with message 'Syntax Error
in template "/var/www/...test.tpl" on line 24 "{if $products|@count ==
2}" - Unexpected " == ", expected one of: "}"' in /var/www/.../
sysplugins/smarty_internal_templatecompilerbase.php:390

Stack trace:
#0 /var/www/.../sysplugins/smarty_internal_templateparser.php(2350):
Smarty_Internal_TemplateCompilerBase->trigger_template_error()
#1 /var/www/.../sysplugins/smarty_internal_templateparser.php(2415):
Smarty_Internal_Templateparser->yy_syntax_error(59, ' == ')
#2 /var/www/.../sysplugins/smarty_internal_smartytemplatecompiler.php
(46): Smarty_Internal_Templateparser->doParse(59, ' == ')
#3 /var/www/.../sysplugins/smarty_internal_templatecompilerbase.php
(80): Smarty_Internal_SmartyTemplateCompiler->doCompile('<h1
class="sect...')
#4 /var/www/.../sysplugins/smarty_internal_template.php(257):
Smarty_Internal_TemplateCompilerBa in /var/.../sysplugins/
smarty_internal_templatecompilerbase.php on line 390

{if $products|count == 2} (without the @) drops the same error.

uwe.tews

unread,
Dec 28, 2009, 10:41:07 AM12/28/09
to Smarty Developers
This is a parser bug.

I try to fix it ASAP.

The possible workaround for the time being is:

{if ($products|count) == 2}

Reply all
Reply to author
Forward
0 new messages