Re: New looping method proposal
| From: | Ivo Jansch | Date: | Mon, 19 Nov 2001 12:23:46 +0000 |
| Subject: | Re: New looping method proposal | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1954@lists.php.net to get a copy of this message | ||
Hello,
Andreas Kossmeier wrote:
other considerations: * what about section properties? e.g. {%first%} * how should they be accessible since there is no name?If you use {foreach $projects as $index => $project}, then 'index' is the name you're looking for. An additional benefit would be if you could use this index to do some math: $project[$index-1] looks more flexible than $projects[index_prev] I don't fully agree with the remark from some people that template designers have to learn stuff, so it doesn't need to be easy. I think that if people can learn easy stuff, they shouldn't need to learn hard stuff. It's just something that came up when looking at the template designers I work with. sections are so unnatural, that poeple try all sorts of things to make it look more natural. (Naming a section 'i' is a common thing I've seen) Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl