[Catalyst] Modifying a value returned with DBIC

Xavier Robin robin0 at etu.unige.ch
Fri Jan 5 10:43:21 GMT 2007


On Friday 05 January 2007 06:19, Octavian Rasnita wrote:
>
> But I want to replace \n in the body of the messages with <br />, and who
> knows, maybe other such format changes.
>

I solved this thing myself by using the replace method described here : 
http://search.cpan.org/~abw/Template-Toolkit-2.15/lib/Template/Manual/VMethods.pod

So in your template:

[% FOREACH message IN messages %]
<p>[% message.replace('\n', '<br>') %]
[% END %]

That should do it !

Xavier

-- 
Some people says that if you play a Windows XP install CD backwards you will 
hear demon voices commanding you to worship Satan. But that's nothing. If you 
play it forward it will install Windows XP.



More information about the Catalyst mailing list