Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: An Idea for a New Template Toolkit Improvement(?)

by monsieur_champs (Curate)
on Mar 30, 2004 at 20:42 UTC ( [id://341093]=note: print w/replies, xml ) Need Help??


in reply to Re: An Idea for a New Template Toolkit Improvement(?)
in thread An Idea for a New Template Toolkit Improvement(?)

Thank you very much for the example code. I'm so annoyed that I just can't figure out a full example

Where almost there. The only thing wrong is that I want the Template file to pass in the code, not the Perl file.

Is that possible? How can I start implement it? Maybe mr. Wardley would appreciate a little patch... (:

Any suggestions?


"In few words, translating PerlMonks documentation and best articles to other languages is like building a bridge to join other Perl communities into PerlMonks family. This makes the family bigger, the knowledge greater, the parties better and the life easier." -- monsieur_champs

Replies are listed 'Best First'.
Re: Re: Re: An Idea for a New Template Toolkit Improvement(?)
by amw1 (Friar) on Mar 30, 2004 at 21:00 UTC

    You could turn on perl evaluation inside of the template. This would let you inline small chunks of perl code within the template. I generally try to write around doing things like that (for personal style issues mostly) but there's nothing really wrong with it.

    You could also have the perl function eval the argument that is passed to it. Generate the string of perl foo and pass that to a function similar to ContextString in my above example and have it get eval'ed

      That does pose some dangers. The most significant is that it makes it easier to succumb to the temptation of pushing logic into the presentation layer. If this seems unavoidable, a cleaner solution would be to build a plugin to handle logic issues.

      Cheers,
      Ovid

      New address of my CGI Course.

Re: Re: Re: An Idea for a New Template Toolkit Improvement(?)
by clscott (Friar) on Mar 30, 2004 at 20:57 UTC
    You should try the tt mailing list:
    http://www.template-toolkit.org/info.html#lists
    --
    Clayton
      Just for easier access: tt mailing list.

      FYI, this link is done by writing [http://www.template-toolkit.org/info.html#lists|tt mailing list].

      -- Hofmator

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://341093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-29 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found