X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FController.pm;h=73c647f537fa7d080b3d807db2dbe60bd2755d80;hb=refs%2Fheads%2Fno_path_dispatch;hp=15941723e2c16eba26572073bd67c5821e969f47;hpb=9c1fc6d6a8c4701fa842fa5229c99d103aee1afa;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index 1594172..73c647f 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -458,7 +458,12 @@ sub _parse_Absolute_attr { shift->_parse_Global_attr(@_); } sub _parse_Local_attr { my ( $self, $c, $name, $value ) = @_; # _parse_attr will call _parse_Path_attr for us - return Path => $name; + $name = join( '/', $self->path_prefix($c), $name); + $name =~ s!^/!!; + return ( + 'Chained' => '/', + 'PathPart' => $name + ); } sub _parse_Relative_attr { shift->_parse_Local_attr(@_); } @@ -467,14 +472,18 @@ sub _parse_Path_attr { my ( $self, $c, $name, $value ) = @_; $value = '' if !defined $value; if ( $value =~ m!^/! ) { - return ( 'Path', $value ); } elsif ( length $value ) { - return ( 'Path', join( '/', $self->path_prefix($c), $value ) ); + $value = join( '/', $self->path_prefix($c), $value ) } else { - return ( 'Path', $self->path_prefix($c) ); + $value = $self->path_prefix($c) } + $value =~ s!^/!!; + return ( + 'Chained' => '/', + 'PathPart' => $value + ); } sub _parse_Chained_attr { @@ -649,7 +658,7 @@ overridden from the "namespace" config key. =head2 $self->path_prefix($c) -Returns the default path prefix for :PathPrefix, :Local, :LocalRegex and +Returns the default path prefix for :PathPrefix, :Local and relative :Path actions in this component. Defaults to the action_namespace or can be overridden from the "path" config key. @@ -751,7 +760,9 @@ This is a general toolbox for attaching your action to a give path. =head2 Regexp -Status: Deprecated. Use Chained methods or other techniques +B Use Chained methods or other techniques. +If you really depend on this, install the standalone +L distribution. A global way to match a give regular expression in the incoming request path. @@ -759,6 +770,10 @@ A global way to match a give regular expression in the incoming request path. =head2 LocalRegexp +B Use Chained methods or other techniques. +If you really depend on this, install the standalone +L distribution. + Like L but scoped under the namespace of the containing controller =head2 Chained