X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FPath.pm;h=7f291db4624356d0efe53e601e2bba083bbf03d1;hp=f51387c3002a81caf35c8e56e421038100c49c6e;hb=22f3a8dd32e5940d87a1d21642fa39c7813bc921;hpb=6b23994966a2a66b90986a51e7e1d71f62d90f44 diff --git a/lib/Catalyst/DispatchType/Path.pm b/lib/Catalyst/DispatchType/Path.pm index f51387c..7f291db 100644 --- a/lib/Catalyst/DispatchType/Path.pm +++ b/lib/Catalyst/DispatchType/Path.pm @@ -19,21 +19,24 @@ sub prepare_action { sub register_action { my ( $self, $c, $action ) = @_; + my $attrs = $action->attributes; my @register; + foreach my $r (@{$attrs->{Path} || []}) { - unless ($r =~ m!^/!) { + unless ($r =~ m!^/!) { # It's a relative path $r = $action->prefix."/$r"; } push(@register, $r); } if ($attrs->{Global} || $attrs->{Absolute}) { - push(@register, $action->name); + push(@register, $action->name); # Register sub name against root } if ($attrs->{Local} || $attrs->{Relative}) { push(@register, join('/', $action->prefix, $action->name)); + # Register sub name as a relative path } foreach my $r (@register) {