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

how to do WHILE if while is not available ?

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


Joined: 11 Apr 2010
Posts: 48

PostPosted: Sat Feb 10, 2018 12:25 am    Post subject: how to do WHILE if while is not available ? Reply with quote

Smarty: 2.6.26

I'm wanting a counter, and loop until it reaches a number, increasing by 1 each time.

unfortunately, the WHILE command is not working / not available to me.

any suggestions ?

$x = 1

(do while)
$x++

if $x > 20 - End routine & go to the next part of the smarty template
(just basic / example code - not exact code i know)
Back to top
View user's profile Send private message
sarahfoxnz
Smarty Regular


Joined: 11 Apr 2010
Posts: 48

PostPosted: Sat Feb 10, 2018 4:14 am    Post subject: Reply with quote

Ive fixed it within PHP itself (creating a text file with the OPTIONS (select field in a form) and use Smarty to just quote/print the text in the right place.
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