Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Syntax error with Smarty

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


Joined: 24 Aug 2016
Posts: 1

PostPosted: Wed Aug 24, 2016 11:54 am    Post subject: Syntax error with Smarty Reply with quote

Hi guys I have the following code:

Code:
{for $i=1 to 35}
   {if hasField id=$i}
      <label for="{getField id=$i}">
         {getCaption id=$i}
      </label>
      <input type="text" value="{getFieldValue id=$i}">
   {/if}
{/for}


And I have a syntax error regarding an unexpected id in line 2. What's happening here? Thanks so much in advance
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1642

PostPosted: Wed Aug 24, 2016 2:37 pm    Post subject: Reply with quote

"{if hasField id=$i}"
is, quite obviously, not a valid "if" syntax.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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