Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Don't ask to ask, just ask
 
PerlMonks  

Re: Template / Class DBI question

by cees (Curate)
on Aug 11, 2005 at 15:40 UTC ( [id://483097]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Template / Class DBI question

You need to use a temporary variable if you want to do that.

[% SET proper_name = person.name _ ' PHD' %]

Or if you really wanted to, you could probably define a TEMP column in your Class::DBI table, which would allow you to do something like this (untested):

[% person.proper_name = person.name _ ' PHD' %]

Either way, I think this type of code really doesn't belong in the template though. Unless you have no other option, you should keep this out of the template to leave your templates as simple as possible.

If you use the TEMP column trick in Class::DBI then just predefine the proper name in your code somewhere, and then just use [% person.proper_name %] directly in your template.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://483097]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.