Re: [SMARTY-DEV] Smarty looping w/ interator
| From: | boots | Date: | Tue, 15 Jul 2003 23:41:43 +0000 |
| Subject: | Re: [SMARTY-DEV] Smarty looping w/ interator | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-1726@lists.php.net to get a copy of this message | ||
This sounds familiar--I believe there is at least one topic relating to
this at the user forums. Not withstanding Wom.Bat's concerns, there are
several possible ways that I can immediately think of to enable this
approach. For example, you can create a custom block function using the
CVS repeat feature; you can register a custom function that returns
back data like a stack; you can register/assign objects that are used
to retrieve data back at runtime from within your Smarty loop.
I think Wom.Bat is carrying the right torch, though--data preparation
should be carried out as a seperate processing chore from the output
transformation that Smarty does. Still, you may save some cycles (and
memory requirements) by using assign_by_ref when you are assigning
(larger) arrays and objects to Smarty.
On the other hand, I'd love to see better recursion in the core. As for
that, I am presently satisified by a variant of the plugins that messju
provided, again at the forums. I think, though, that native support for
recursion (and/or macros, callable template parts, etc.) would provide
a more direct path for users coming from 'certain other' template
systems and methodologies.
xo boots
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com