Modify(regex) content/body before output
roland16 <[email protected]> Fri, 20 Jan 2017 17:04:27 +0100
| Newsgroups | gmane.comp.web.mason.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm trying to perform a regexp on body/content just before outputing it. I tried using filter in Base.mc
<%around handle>
<% sub { $_[0] =~ s/old_value/new_value/gsi; return $_[0];} { %>
% $self->$orig();
</%>
</%around>
but it doesn't affect code blocks inside Defer methods.
I also tried to use it in Base.mp, but i don't know how to extract body variable
around 'handle' => sub {
my ($orig, $class, $args) = @_;
return $class->$orig($args);
};
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot