[Catalyst] displaying email addresses
Octavian Rasnita
orasnita at gmail.com
Thu Jun 28 13:41:59 GMT 2007
Ok, thank you all. I think I will use this method and the Email::Find module
to do what I want.
Octavian
----- Original Message -----
From: "Marc Logghe" <Marc.Logghe at DEVGEN.com>
To: "The elegant MVC web framework" <catalyst at lists.rawmode.org>
Sent: Thursday, June 28, 2007 3:05 PM
Subject: RE: [Catalyst] displaying email addresses
> Do you know if there are any Catalyst plugins, or TT filters,
> or perl modules that can find all the email addresses in a
> text and convert them into a Javascript code that prints that
> email address (possibly as a link)?
Don't know about plugins or something. But I guess you can easily
achieve that by filtering your body just before sending to the browser.
sub render :ActionClass('RenderView') {}
sub end :Private {
my ( $self, $c ) = @_;
# do something before rendering
$c->forward('render');
# do something after rendering
$c->forward->filter($body);
}
sub filter :Private {
my ( $self, $c ) = @_;
my $body = $c->response->body();
# replace email adresses
....
$c->response->body($body);
}
Don't know about TT, but if you use Mason as a view you could put the
filter code in a <filter> tag in your autohandler or something:
http://masonhq.com/docs/manual/Devel.html#filtering
Cheers,
Marc
_______________________________________________
List: Catalyst at lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
More information about the Catalyst
mailing list