X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalystX%2FRoutes.pm;h=ccd2fa7c413b957929d5f4b793c677b4fde00a69;hb=7bdb05c2732d4d130a42713e8bd6507d7fadb44c;hp=72f776093c4e27c77e1fdc5799d063a7d52fa6b3;hpb=f57cfc353ed96829165ee313af8d3eddb549e3da;p=catagits%2FCatalystX-Routes.git diff --git a/lib/CatalystX/Routes.pm b/lib/CatalystX/Routes.pm index 72f7760..ccd2fa7 100644 --- a/lib/CatalystX/Routes.pm +++ b/lib/CatalystX/Routes.pm @@ -56,6 +56,8 @@ sub _add_route { $name = ( $attrs->{Chained} eq '/' ? q{} : $attrs->{Chained} ) . q{/} . $name; + $name =~ s{/}{|}g; + my $meth_base = '__route__' . $name; _maybe_add_rest_route( $meta, $meth_base, $attrs ); @@ -78,6 +80,7 @@ sub _add_chain_point { my ( $attrs, $sub ) = _process_args( $meta, @_ ); my $name = $_[0]; + $name =~ s{/}{|}g; $meta->add_chain_point( $name => [ $attrs, $sub ] ); } @@ -109,6 +112,7 @@ sub _process_args { unless ( $part =~ s{^/}{} ) { $part = join q{/}, $meta->name()->action_namespace('FakeConfig'), $part; + $part =~ s{^/}{}; } } @@ -314,7 +318,7 @@ Use this to declare an action class. By default, this will be L for end points. For other parts of a chain, it simply won't be set. -=head1 Path Generation +=head1 PATH GENERATION All of the end point function (C, C, etc.) take a path as the first argument. By default, this will be used as the C for the chain. You @@ -333,6 +337,15 @@ root URI, C, as the root of the chain. By default, no arguments are specified for a chain's end point, meaning it will accept any number of arguments. +=head1 CAVEATS + +When adding subroutines for end points to your controller, a name is generated +for each subroutine based on the chained path to the subroutine. Some +template-based views will automatically pick a template based on the +subroutine's name if you don't specify one explicitly. This won't work very +well with the bizarro names that this module generates, so you are strongly +encouraged to specify a template name explicitly. + =head1 BUGS Please report any bugs or feature requests to