[Catalyst] Subclassing using Catalyst::Controller::REST
prasad guna
mopiw171 at gmail.com
Mon Jun 7 09:15:40 GMT 2010
HI All,
I have implemented REST-ful interface to my app using
Catalyst::Controller::Rest;
i have several controllers and ideally i wanted to do something like this,
package MyApp::Controller::RestOne;
use base 'MyApp::Controller::RestParent';
sub thingOne:Path: ActionClass('REST'){}
in the other class,
package MyApp::Controller::RestTwo;
use base 'MyApp::Controller::RestParent';
sub thingTwo:Path: ActionClass('REST'){}
in the base class,
package MyApp::Controller::RestParent;
use base 'Catalyst::Controller::REST';
sub begin:Private{}
....
in my config file, i have
<Controller RestParent>
stash_key rest
<map>
text/html View
text/html TT
text/xml XML::Simple
text/x-yaml YAML
application/json JSON
text/x-json JSON
</map>
</Controller>
and all the subclasses should inherit this config from the parent, and
render the output using TT, however the child classes are using the default
config and renders the output using YAML::HTML,
so ideally what i need is, when a request is made the subclass should use
the config from the parent class and forward to View::TT,
Please let me know, how to do this.
regards,
Prasad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100607/1deb1=
8e9/attachment.htm
More information about the Catalyst
mailing list