[Catalyst] RESTful perl implementations...
Matt S Trout
dbix-class at trout.me.uk
Tue Sep 26 16:44:33 CEST 2006
Garrett Goebel wrote:
> I'm sure this is too late to be useful. But here is my subclassed
> Catalyst::Action to implemented RESTful request method based
> dispatching. [I've been working on this in my free time. Which I have
> precious little of lately. My apologies.]
>
> The references to $c->request->path_parameters are to support RoR
> style processing of urls (foo.com/person;create) where
> Catalyst::Dispatcher->perpare_action is overridden to match url paths
> separate from path parameters and file extensions.
>
> I also override Catalyst::Dispatcher->setup_actions to change the
> default method_action_class to my subclass of Catalyst::Action. I was
> surprised that default method_action_class and action_container_class
> appear to be hard coded...
These shouldn't need to be altered - the action class for dispatchable actions
can be applied via :ActionClass or for an entire controller via classdata.
method_action_class is -only- for ->forward(qw/Comp::Class methodname/) and
can easily be overridden by setting the appropriate accessor after
setup_dispatcher, so I don't really see it as hard coding.
If you'd like to be able to pass parameters like that to the ->new call when
the dispatcher is instantiated, a patch and tests to get that from
->config->{dispatcher} on the app would be happily applied.
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Catalyst
mailing list