[Catalyst] Dispatching based on path and host/domain

Curtis Fletcher curtis.fletcher at pharmaventures.com
Wed Apr 23 15:25:47 BST 2008


> -----Original Message-----
> From: Matt S Trout [mailto:dbix-class at trout.me.uk] 
> Sent: 23 April 2008 14:34
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Dispatching based on path and host/domain
> 
> :Local is a shortcut for 
> :Path($controller->path_prefix.'/'.$method_name)
> 
> Those values came straight off the attributes - you'd set the 
> Domain key
> just by using :Domain('foobar.com') exactly as you did in 
> your original
> example (which is where I got the key name from :)

And the light comes on because someone is finally home!
I was thinking that :Local :Path etc were shortcuts to defining an
ActionClass not attributes to the (mostly) default ActionClass. Bingo it
all makes sense now. Many thanks.

Digging around, is it a sane thing to have:

__PACKAGE__->_action_class('Catalyst::Action::MyAction');

At the top of a controller if I want all of the methods to use the same
non-default ActionClass? I'm nervous about using anything that starts
with _

On a related note: While I was looking for information about setting a
default ActionClass I came across the ActionClass info in
http://search.cpan.org/~mstrout/Catalyst-Manual-5.701004/lib/Catalyst/Ma
nual/ExtendingCatalyst.pod I wish I'd found that at the start, maybe
I'll put together a patch for the Catalyst::Action and
Catalyst::Manual::Actions pod that points people back there for info
about using "match" (does that sound like a good thing to do?)



More information about the Catalyst mailing list