[Catalyst] displaying email addresses

Marc Logghe Marc.Logghe at DEVGEN.com
Thu Jun 28 13:05:19 GMT 2007


> 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



More information about the Catalyst mailing list