enhanced foreach loops

Kerry Wilson <[email protected]> Thu, 16 Nov 2006 13:32:26 -0500
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
I would like to enhance the foreach loop by adding next and previous to 
the foreach variables.

Example usage:

{foreach from=$message.backtrace item='call' name='backtrace'}
  {assign var='previous_call' value=|$smarty.foreach.backtrace.next}|
  <li style='list-style: none;'>{$call.file} [{$call.line}] - 
{$previous_call.class}.{$previous_call.function}(){/if}</li>
{/foreach}

In case you cannot tell I am using this to print a backtrace ( I want it 
to show the method it is currently in, not the one that it is calling ).

Where does the foreach implementation reside in source?  And is this a 
good thing to add to the base code?

-- 
Kerry Wilson
Lead Developer
Williams Web
[email protected] | 423.485.4747

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php