[Catalyst] RESTful perl implementations...

Garrett Goebel ggoebel at goebel.ws
Tue Sep 26 18:57:00 CEST 2006


On Sep 26, 2006, at 9:44 AM, Matt S Trout wrote:

> 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.

Perhaps it is a matter of taste, but I find appending :ActionClass to  
dispatchable actions to be clunky.

Time permitting, I'll pour through the documentation and code on how  
to do that with "an entire controller via classdata". Or if you can  
point me directly to the relevant documentation that would be greatly  
appreciated.

> 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.

That's good to know.

> 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.

Time permitting... I give that a try.

thanks for the feedback,

Garrett





More information about the Catalyst mailing list