X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FController.pm;h=03d443ae3defd2dd408d7dd57988025e81e4aa43;hb=e5d2cfdb03e4f8678893e7ceb550f2b4303f2d3a;hp=b0828ab218768ed99d6964f0acec839f64b9c85e;hpb=53119b7876049abfe0d4e4bea5e85724dd4778d7;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index b0828ab..03d443a 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -270,11 +270,20 @@ sub _parse_Regexp_attr { shift->_parse_Regex_attr(@_); } sub _parse_LocalRegex_attr { my ( $self, $c, $name, $value ) = @_; unless ( $value =~ s/^\^// ) { $value = "(?:.*?)$value"; } - return ( 'Regex', '^' . $self->path_prefix($c) . "/${value}" ); + + my $prefix = $self->path_prefix( $c ); + $prefix .= '/' if length( $prefix ); + + return ( 'Regex', "^${prefix}${value}" ); } sub _parse_LocalRegexp_attr { shift->_parse_LocalRegex_attr(@_); } +sub _parse_PathPrefix_attr { + my $self = shift; + return PathPart => $self->path_prefix; +} + sub _parse_ActionClass_attr { my ( $self, $c, $name, $value ) = @_; unless ( $value =~ s/^\+// ) { @@ -342,8 +351,8 @@ overridden from the "namespace" config key. =head2 $self->path_prefix($c) -Returns the default path prefix for :Local, :LocalRegex and relative -:Path actions in this component. Defaults to the action_namespace or +Returns the default path prefix for :PathPrefix, :Local, :LocalRegex and +relative :Path actions in this component. Defaults to the action_namespace or can be overridden from the "path" config key. =head2 $self->create_action(%args)