Jeff-Lewis / smarty-php

Automatically exported from code.google.com/p/smarty-php
0 stars 0 forks source link

unrecognized tag 'while'/'for' #214

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in my tpl test page this is the code

{assign var=foo value=5}
<ul>
{while $foo > 0}
  <li>while {$foo}</li>
  {$foo--}
{/while}
</ul>

<ul>
{for foo=1 to 3}
    <li>for {$foo}</li>
{/for}
</ul>

this is the output
Fatal error: Smarty error: [in index.tpl line 83]: syntax error: unrecognized 
tag 'while' (Smarty_Compiler.class.php, line 590) in 
/home/a6814821/public_html/TestSmarty/lib/Smarty-2.6.28/libs/Smarty.class.php 
on line 1094

Fatal error: Smarty error: [in index.tpl line 83]: syntax error: unrecognized 
tag 'for' (Smarty_Compiler.class.php, line 590) in 
/home/a6814821/public_html/TestSmarty/lib/Smarty-2.6.28/libs/Smarty.class.php 
on line 1094

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Smarty Version 2.6.28
Apache ver.     2.2.19 (Unix)
PHP version     5.2.*

Please provide any additional information below.

Original issue reported on code.google.com by ttoDF...@gmail.com on 24 Nov 2014 at 11:21

GoogleCodeExporter commented 9 years ago
The {for} and {while} tags are not available in Smarty 2. They have been 
introduced in Smarty 3.

Original comment by Uwe.Tews@googlemail.com on 13 May 2015 at 5:52