聪明的while循环错误

ala*_*gar 3 smarty while-loop

官方文档说聪明有"同时"的支持.但是我在模板中做了以下事情:

{while $foo > 0}
  {$foo--}
{/while}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

语法错误:无法识别的标签'while'(Smarty_Compiler.class.php)

你能帮忙解决这个问题吗?非常感谢.

小智 5

你可能正在使用一个老版本(没有while)smarty,这就是你得到错误的原因