Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Smarty 3.0 Alpha 1: Proof of Concept
Goto page Previous  1, 2, 3, 4, 5, 6, 7
 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
goper
Smarty Rookie


Joined: 24 Jul 2007
Posts: 5

PostPosted: Fri Nov 06, 2009 9:01 am    Post subject: Reply with quote

U.Tews wrote:
This was discussed already earlier.

For good reasons the final decission was NO.


Can you PM me, why is writing like that is bad?

U.Tews wrote:
Config files can now be loaded from the script on data and template objects.

$tpl = $smarty->createTemplate('mytpl.tpl'); // create template object
$tpl->config_load('my.conf'); // load config file


Is there a way to get config, without creating a template?
Back to top
View user's profile Send private message
douglassdavis
Smarty Elite


Joined: 21 Jan 2008
Posts: 263

PostPosted: Tue Dec 01, 2009 6:09 pm    Post subject: Reply with quote

PHP/C style for loops are usually one of the most difficult things for non-programmers and novice programmers to learn. They often run into infinite loops and other problems.

I'm sure it's too late to mention this now, and it may be a totally stupid, but, since I just thought about it, I'll bring up the question anyway. Laughing What if the for loops were more Basic style?

I.e. simple syntax, no infinite loops.


Code:

{for $x = 0 to 5}
  HTML here
{/for}


Code:

{for $x = 5 to 0 step -1}
  HTML here
{/for}
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue Dec 01, 2009 9:52 pm    Post subject: Reply with quote

douglassdavis wrote:
PHP/C style for loops are usually one of the most difficult things for non-programmers and novice programmers to learn. They often run into infinite loops and other problems.

I'm sure it's too late to mention this now, and it may be a totally stupid, but, since I just thought about it, I'll bring up the question anyway. Laughing What if the for loops were more Basic style?

I.e. simple syntax, no infinite loops.


Code:

{for $x = 0 to 5}
  HTML here
{/for}


Code:

{for $x = 5 to 0 step -1}
  HTML here
{/for}


Great idea. Lets flesh this out. The new {foreach} syntax and this {for} syntax will be a welcome addition. The traditional for and foreach syntax will also be supported, but the simpler syntaxes will be outlined in the docs.

It does not forgo infinite loops, but it makes an easier read.
_________________
Monte
http://www.phpinsider.com/
http://mohrt.blogspot.com/
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 -> Smarty 3 All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7
Page 7 of 7

 
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