smarty while-loop error
The official docs says that smarty has 'while' support . However I do in template the following:
{while $foo > 0}
{$foo--}
{/while}
and I get the following error :
syntax error: unrecognized tag 'while' (Smarty_Compiler.class.php)
Can you please help with that issue ? Thanks a lot开发者_如何学JAVA.
You are probably using an old version (without while
) of smarty, that's why you get the error
As @RC said, you are probably using Smarty v2. If you can't upgrade to v3, you'd want to look at {section}
or maybe {foreach}
for looping.
精彩评论