[Catalyst-dev] RT #36209: convert internal path seperators for clarity

Matt S Trout dbix-class at trout.me.uk
Sun Jun 1 08:12:23 BST 2008


On Sat, May 31, 2008 at 08:58:38AM -0400, Hans Dieter Pearcey wrote:
> On Thu, May 29, 2008 at 09:35:57AM -0700, J. Shirley wrote:
> > > $c->forward('Foo::bar') for MyApp::Controller::Foo::bar?
> > >
> > 
> > That seems by far to make the most sense, and really should clarify things.
> 
> It will un-clarify any controller that changes config->{namespace}.

Well ... not really. I think it would simply ignore config->{namespace}.

Perhaps better would be 'Foo->bar', then the code basically becomes

my $action = $c->controller(split('->', $str)[0])
               ->action_for(split('->', $str)[1]);

I can see only two reasons for wanting to change the private path:

(1) in Root.pm to provide base /begin /auto and /end actions for the whole app
(2) to split a large controller up into several but still $c->forward('foo')

Maybe we should look at finding a way to handle these cases that's saner.

I'm pretty sure the private namespace is basically useless for anything else
(yes, uri_for uses it, but any code that uses uri_for without either an action
object or an absolute URL is basically broken and the new action_uri/whatever
methods shouldn't need it at all).

> Are there any other cases where private path names don't match $package ::
> $methodname?

Not that I can think of.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst-dev mailing list