X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FBase.pm;h=cd14a4cffe1454c13fbf639fdbc4f6e5b492ebb4;hp=a90656c66927adb5a5c04aae2ab0275fc29ce694;hb=1b1636b58ce5f1feabd0d125c3928c57e5a5cf3c;hpb=2dbdc32ced171ec14fed4d01ca823267af1600ba diff --git a/lib/Catalyst/Base.pm b/lib/Catalyst/Base.pm index a90656c..cd14a4c 100644 --- a/lib/Catalyst/Base.pm +++ b/lib/Catalyst/Base.pm @@ -79,7 +79,9 @@ dispatch of actions for controllers. =head2 $self->action_namespace($c) -Determine the namespace for actions in this component. +Returns the private namespace for actions in this component. Defaults to a value +from the controller name (for e.g. MyApp::Controller::Foo::Bar becomes +"foo/bar") or can be overriden from the "namespace" config key. =cut @@ -94,11 +96,18 @@ sub action_namespace { =head2 $self->path_prefix($c) -alias for action_namespace +Returns the default path prefix for :Local, :LocalRegex and relative :Path +actions in this component. Defaults to the action_namespace or can be +overriden from the "path" config key. =cut -sub path_prefix { shift->action_namespace(@_); } +sub path_prefix { + my ( $self, $c ) = @_; + my $hash = (ref $self ? $self : $self->config); # hate app-is-class + return $hash->{path} if exists $hash->{path}; + return shift->action_namespace(@_); +} =head2 $self->register_actions($c)