[Templates] how do I find all parsed tags?

Blue Eyed Devil eyed_devil_blue at hotmail.com
Mon Jun 30 21:23:19 BST 2008


 
 Good thinking Sean! That would be perfect. The goal is to get it as it is to give the user the choice to handle it however he/she wants it to (even tho it would be great to be able to take advantage of TT's features and in the example of FOO; BAR; BAZ each get their own entry in @tags.  Either way, if the former can be implemented properly, more power is given to the developer since the developer has the choice of doing whatever he or she wants to do with the data (even to implement the latter of your thoughts)... 
 
 Milan


Date: Mon, 30 Jun 2008 11:44:48 -0700From: eefacm at gmail.comTo: eyed_devil_blue at hotmail.comSubject: Re: [Templates] how do I find all parsed tags?CC: templates at template-toolkit.orgOn Mon, Jun 30, 2008 at 11:15 AM, Blue Eyed Devil <eyed_devil_blue at hotmail.com> wrote:


  The reasons as to why a particular feature is desired/needed may not be evident until the need presents itself. This would be one of such times.  Maybe something along the lines (semi-pseudocode):  ... 
 my @all_tags = $parser->tags; $output .= $_->new->execute() for @tags;
Just be aware that my solution gives you only the lexical content of the tags, so that the tag [% FOO | html %] would be returned as "FOO | html", not just "FOO".  And if you had a tag [% FOO; BAR; BAZ %], you'd get the string "FOO; BAR; BAZ".  If you need to get at the actual semantics of the document--for example, if you needed the three separate tags "FOO", "BAR", and "BAZ" above--you'll need to roll your own code to get it, or find the right place to hook into the existing framework.--Sean
_________________________________________________________________
The other season of giving begins 6/24/08. Check out the i’m Talkathon.
http://www.imtalkathon.com?source=TXT_EML_WLH_SeasonOfGiving
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.template-toolkit.org/pipermail/templates/attachments/20080630/fe15de2f/attachment.htm 


More information about the templates mailing list