X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=4f92467f6a164e17e2e87be49d250d34da09cf3d;hb=e358ade7c046b92ae117b0b242ac1a24e22b0d92;hp=e581ba1178f839fdbe2771a6cf2168ada4fe8ce9;hpb=d134bcca06274815d0e9c3ff44171742cf6f5f49;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index e581ba1..4f92467 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -357,6 +357,13 @@ Almost the same as C, but does a full dispatch, instead of just calling the new C<$action> / C<$class-E$method>. This means that C, C and the method you go to are called, just like a new request. +In addition both C<< $c->action >> and C<< $c->namespace >> are localized. +This means, for example, that $c->action methods such as C, C and +C return information for the visited action when they are invoked +within the visited action. This is different from the behavior of C +which continues to use the $c->action object from the caller action even when +invoked from the callee. + C<$c-Estash> is kept unchanged. In effect, C allows you to "wrap" another action, just as it @@ -1047,6 +1054,31 @@ EOF $meta->make_immutable unless $meta->is_immutable; }, Scope::Upper::SCOPE(1)); + $class->setup_finalize; +} + + +=head2 $app->setup_finalize + +A hook to attach modifiers to. +Using C< after setup => sub{}; > doesn't work, because of quirky things done for plugin setup. +Also better than C< setup_finished(); >, as that is a getter method. + + sub setup_finalize { + + my $app = shift; + + ## do stuff, i.e., determine a primary key column for sessions stored in a DB + + $app->next::method(@_); + + + } + +=cut + +sub setup_finalize { + my ($class) = @_; $class->setup_finished(1); }