 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
goper Smarty Rookie
Joined: 24 Jul 2007 Posts: 5
|
Posted: Fri Nov 06, 2009 9:01 am Post subject: |
|
|
| 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 |
|
douglassdavis Smarty Elite
Joined: 21 Jan 2008 Posts: 263
|
Posted: Tue Dec 01, 2009 6:09 pm Post subject: |
|
|
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. 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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 5555 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 01, 2009 9:52 pm Post subject: |
|
|
| 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. 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 |
|
|
|
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
|