开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜