X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=README;h=fcab6bd1d9c518fc9fb90960cbe847f8cafee01d;hb=f10644864a543bf49bb2473c0809e376f9ec1fb4;hp=8da598bc561129e438f43c437d26d365b88389ce;hpb=8f00a41bd7efb75d302d0a333e0eb5bc7d75c931;p=catagits%2FCatalyst-Action-REST.git diff --git a/README b/README index 8da598b..fcab6bd 100644 --- a/README +++ b/README @@ -1,6 +1,9 @@ NAME Catalyst::Controller::REST - A RESTful controller +VERSION + 0.73 + SYNOPSIS package Foo::Controller::Bar; @@ -135,14 +138,24 @@ AVAILABLE SERIALIZERS { data => $yourdata } + View + Uses a regular Catalyst view. For example, if you wanted to have your + "text/html" and "text/xml" views rendered by TT: + + 'text/html' => [ 'View', 'TT' ], + 'text/xml' => [ 'View', 'XML' ], + + Will do the trick nicely. + By default, Catalyst::Controller::REST will return a "415 Unsupported Media Type" response if an attempt to use an unsupported content-type is made. You can ensure that something is always returned by setting the "default" config option: - __PACKAGE__->config->{'serialize'}->{'default'} = 'YAML'; + __PACKAGE__->config->{'serialize'}->{'default'} = 'text/x-yaml'; - Would make it always fall back to YAML. + Would make it always fall back to the serializer plugin defined for + text/x-yaml. Implementing new Serialization formats is easy! Contributions are most welcome! See Catalyst::Action::Serialize and @@ -259,8 +272,7 @@ IMPLEMENTATION DETAILS ], 'text/x-config-general' => [ 'Data::Serializer', 'Config::General' ] , - 'text/x-php-serialization' => [ 'Data::Serializer', 'PHP::Serializat - ion' ], + 'text/x-php-serialization' => [ 'Data::Serializer', 'PHP::Serialization' ], }, } ); @@ -272,22 +284,22 @@ IMPLEMENTATION DETAILS The "begin" method uses Catalyst::Action::Deserialize. The "end" method uses Catalyst::Action::Serialize. If you want to override either behavior, simply implement your own "begin" and "end" actions - and use NEXT: + and use MRO::Compat: my Foo::Controller::Monkey; use base qw(Catalyst::Controller::REST); sub begin :Private { my ($self, $c) = @_; - ... do things before Deserializing ... - $self->NEXT::begin($c); + ... do things before Deserializing ... + $self->maybe::next::method($c); ... do things after Deserializing ... } sub end :Private { my ($self, $c) = @_; - ... do things before Serializing ... - $self->NEXT::end($c); + ... do things before Serializing ... + $self->maybe::next::method($c); ... do things after Serializing ... }