Re: Internal Variables

From: Date: Fri, 23 Feb 2001 20:10:00 +0000
Subject: Re: Internal Variables
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-207@lists.php.net to get a copy of this message
Actually, yeah, that would be perfect! And, personally, I would prefer index_prev, index_next, etc... just reminds me of the atypical method follows object convention. ;) And, _next wouldnt' hurt... like you said, for consistency. At first, I kept thinking that I would need support for variables outside of the scope of sections, but I couldn't think of a scenario where I actually would. -Jason -----Original Message----- From: Andrei Zmievski [mailto:andrei@ispi.net] Sent: Friday, February 23, 2001 10:34 AM To: Alexander, Jason Cc: 'smarty@lists.ispi.net' Subject: [smarty] Re: Internal Variables On Fri, 23 Feb 2001, Alexander, Jason wrote: > Thanks Andrei for the prompt response. > > Hrm, that's unfortunate. Hopefully (for self-serving reasons :D) you guys > can get that in the next release. > > But, I understand your problem. Once you get into parsing the section > directives, how do you (cleanly & easily) handle global directives, such as > "declare", "set", and "unset" directives, hypothetically. Ok, a possible implementation might look like this. Let me know what you think. {section name=my_list loop=$foo} {$my_list/foo} {* indexing by current iteration *} {$my_list.index/foo} {* still indexing by current iteration *} {$my_list.index_prev/foo} {* indexing by previous iteration *} {/section} I am not sure about 'index_next', since there is already 'rownum' which is index + 1. We could still have 'index_next' to be consistent. Or should they be called 'next_index' and 'prev_index'? -Andrei 'Any given program, when running correctly, is obsolete.' - First Law of Computer Programming --- You are currently subscribed to smarty as: jalexander@aivia.net To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/

« previous php.smarty.general (#207) next »