X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FBase.pm;h=b1f105b3787ac249bdcd52611c9e2bdd7cfe2432;hb=f991f6a0dd3b2fc63223bf206c402fce8213807f;hp=6292fd373c1c20efb922e0b0912db28f0eefc1e4;hpb=9c0c383b6f1d8eb25f32313f18d434082018f0b6;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Base.pm b/lib/Catalyst/Base.pm index 6292fd3..b1f105b 100644 --- a/lib/Catalyst/Base.pm +++ b/lib/Catalyst/Base.pm @@ -43,7 +43,12 @@ sub _AUTO : Private { sub _ACTION : Private { my ( $self, $c ) = @_; - $c->action->execute($c); + if ( ref $c->action + && $c->action->isa('Catalyst::Action') + && $c->req->action ) + { + $c->action->execute($c); + } return !@{ $c->error }; } @@ -55,6 +60,24 @@ sub _END : Private { return !@{ $c->error }; } +=head1 NAME + +Catalyst::Base - Catalyst Base Class + +=head1 SYNOPSIS + +See L + +=head1 DESCRIPTION + +Catalyst Base Class + +=head1 METHODS + +=head2 $self->action_namespace($c) + +=cut + sub action_namespace { my ( $self, $c ) = @_; return Catalyst::Utils::class2prefix( ref $self, @@ -62,6 +85,10 @@ sub action_namespace { || ''; } +=head2 $self->register_actions($c) + +=cut + sub register_actions { my ( $self, $c ) = @_; my $class = ref $self || $self; @@ -114,7 +141,8 @@ sub _parse_attrs { # Parse out :Foo(bar) into Foo => bar etc (and arrayify) - if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)\s*\))?$/ ) ) { + if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)\s*\))?$/ ) ) + { if ( defined $value ) { ( $value =~ s/^'(.*)'$/$1/ ) || ( $value =~ s/^"(.*)"/$1/ ); @@ -125,25 +153,9 @@ sub _parse_attrs { return \%attributes; } -=head1 NAME - -Catalyst::Base - Catalyst Controller Base Class - -=head1 SYNOPSIS - - -=head1 DESCRIPTION - - -=head1 METHODS - -=over 4 - -=back - =head1 SEE ALSO -L. +L, L. =head1 AUTHOR