X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FController%2FREST.pm;h=090284ee2110937da0cf145ae4dd307b44726d78;hb=355d4385698315db0f6f1e253836292fecd3b05b;hp=87bb7aaca4bad28f4984b76b1cb8751d0943a361;hpb=46ca391e3e28fb0a6d178503c3ea8d56d57b0f44;p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git diff --git a/lib/Catalyst/Controller/REST.pm b/lib/Catalyst/Controller/REST.pm index 87bb7aa..090284e 100644 --- a/lib/Catalyst/Controller/REST.pm +++ b/lib/Catalyst/Controller/REST.pm @@ -565,28 +565,33 @@ L. The C method uses L. The C method uses L. If you want to override either behavior, simply implement your own C and C actions -and use MRO::Compat: +and forward to another action with the Serialize and/or Deserialize +action classes: package Foo::Controller::Monkey; use Moose; use namespace::autoclean; - + BEGIN { extends 'Catalyst::Controller::REST' } - sub begin :Private { + sub begin : Private { my ($self, $c) = @_; ... do things before Deserializing ... - $self->maybe::next::method($c); + $c->forward('deserialize'); ... do things after Deserializing ... } + sub deserialize : ActionClass('Deserialize') {} + sub end :Private { my ($self, $c) = @_; ... do things before Serializing ... - $self->maybe::next::method($c); + $c->forward('serialize'); ... do things after Serializing ... } + sub serialize : ActionClass('Serialize') {} + =back =head1 A MILD WARNING