Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Template / Class DBI question

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found