1 package Catalyst::DispatchType::Path;
4 use base qw/Catalyst::DispatchType/;
7 my ($self, $c, $path) = @_;
9 if ( my $action = $self->{paths}->{$path} ) {
10 $c->req->action($path);
11 $c->req->match($path);
13 $c->namespace($action->prefix);
21 my ( $self, $c, $action ) = @_;
22 my $attrs = $action->attributes;
24 foreach my $r (@{$attrs->{Path} || []}) {
25 unless ($r =~ m!^/!) {
26 $r = $action->prefix."/$r";
31 if ($attrs->{Global} || $attrs->{Absolute}) {
32 push(@register, $action->name);
35 if ($attrs->{Local} || $attrs->{Relative}) {
36 push(@register, join('/', $action->prefix, $action->name));
39 foreach my $r (@register) {
41 $self->{paths}{$r} = $action;