开发者

smarty while-loop error

开发者 https://www.devze.com 2023-03-05 21:04 出处:网络
The official docs says that smarty has \'while\' support . However I do in template the following: {while $foo > 0}

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

精彩评论

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

关注公众号