How can you avoid setting variables?[...]
[% BLOCK show_list %]
[%
FOREACH item = list;
"Item = [$item]\n";
END;
%]
[% END %]
You're right, that would modify "item" in the stash. I guess the reasons that this is never a problem for me are that I tend to use short throwaway names for loop variables and because I don't put much in the top level of the stash. My data is usually organized underneath a few top-level entries like "config" and "search_results".
What I was really referring to with setting variables is doing calculations, regexes, database queries, XML parsing, etc. in the template and assigning the results to variables in the stash. Some of the advanced users on the list do that quite a bit, but I believe most people use TT in a simpler pipeline style.
- Perrin
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.9 - Release Date: 1/6/2005
_______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
