Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
IF statement 24 condition allowed only

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
webinfovista
Smarty n00b


Joined: 14 Jul 2013
Posts: 1

PostPosted: Sun Jul 14, 2013 10:41 am    Post subject: IF statement 24 condition allowed only Reply with quote

Anyone can help me? why smarty 3 is not allowed more than 24 condition in if statement

check here example : it will be error

{if $pagename eq '1' ||
$pagename eq '2' ||
$pagename eq '3' ||
$pagename eq '4' ||
$pagename eq '5' ||
$pagename eq '6' ||
$pagename eq '7' ||
$pagename eq '8' ||
$pagename eq '9' ||
$pagename eq '10' ||
$pagename eq '11' ||
$pagename eq '12' ||
$pagename eq '13' ||
$pagename eq '14' ||
$pagename eq '15' ||
$pagename eq '16' ||
$pagename eq '17' ||
$pagename eq '18' ||
$pagename eq '19' ||
$pagename eq '20' ||
$pagename eq '21' ||
$pagename eq '22' ||
$pagename eq '23' ||
$pagename eq '24' ||
$pagename eq '25'}

please check in your any template file and

getting error Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template

if you remove 25 condition so it will work fine. why is problem?
Back to top
View user's profile Send private message Send e-mail
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4589
Location: Hamburg / Germany

PostPosted: Sun Jul 14, 2013 10:31 pm    Post subject: Reply with quote

You did run into an internal stack limit of the template parser.
The fix is now in the svn trunk and will later be included in version 3.1.15
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7256
Location: Lincoln Nebraska, USA

PostPosted: Mon Jul 15, 2013 2:13 pm    Post subject: Reply with quote

{if $pagename gte 1 and $pagename lte 25}

Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP