sub _parse_Local_attr {
my ( $self, $c, $name, $value ) = @_;
# _parse_attr will call _parse_Path_attr for us
- return Path => $name;
+ return (
+ 'Chained' => '/',
+ 'PathPart' => join( '/', $self->path_prefix($c), $name)
+ );
}
sub _parse_Relative_attr { shift->_parse_Local_attr(@_); }
sub _parse_Path_attr {
my ( $self, $c, $name, $value ) = @_;
$value = '' if !defined $value;
- if ( $value =~ m!^/! ) {
- return ( 'Path', $value );
+ if ( $value =~ s!^/!! ) {
+ return (
+ 'Chained' => '/',
+ 'PathPart' => $value
+ );
}
elsif ( length $value ) {
- return ( 'Path', join( '/', $self->path_prefix($c), $value ) );
+ return (
+ 'Chained' => '/',
+ 'PathPart' => join( '/', $self->path_prefix($c), $value )
+ );
}
else {
- return ( 'Path', $self->path_prefix($c) );
+ return (
+ 'Chained' => '/',
+ 'PathPart' => $self->path_prefix($c)
+ );
}
}
-sub _parse_Regex_attr {
- my ( $self, $c, $name, $value ) = @_;
- return ( 'Regex', $value );
-}
-
-sub _parse_Regexp_attr { shift->_parse_Regex_attr(@_); }
-
-sub _parse_LocalRegex_attr {
- my ( $self, $c, $name, $value ) = @_;
- unless ( $value =~ s/^\^// ) { $value = "(?:.*?)$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_Chained_attr {
my ($self, $c, $name, $value) = @_;
=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.
=head2 Regexp
-Status: Deprecated. Use Chained methods or other techniques
+B<Status: Deprecated.> Use Chained methods or other techniques.
+If you really depend on this, install the standalone
+L<Catalyst::DispatchType::Regex> distribution.
A global way to match a give regular expression in the incoming request path.
=head2 LocalRegexp
+B<Status: Deprecated.> Use Chained methods or other techniques.
+If you really depend on this, install the standalone
+L<Catalyst::DispatchType::Regex> distribution.
+
Like L</Regex> but scoped under the namespace of the containing controller
=head2 Chained