Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by amw1 (Friar)
on Mar 30, 2004 at 21:00 UTC ( [id://341095]=note: print w/replies, xml ) Need Help??


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

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

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

Replies are listed 'Best First'.
Re(4): An Idea for a New Template Toolkit Improvement(?)
by Ovid (Cardinal) on Mar 30, 2004 at 23:22 UTC

    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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found