From: Marcus Ramberg Date: Sun, 10 Apr 2005 18:34:19 +0000 (+0000) Subject: updated information for auto X-Git-Tag: 5.7099_04~1580 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=80ef2e6d240ab4644261d2e0454bd45ffd20610e updated information for auto --- diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index 4cdbb21..21e1821 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -325,25 +325,45 @@ Called at the end of a request, after all matching actions are called. sub begin : Private { } sub default : Private { } -You can define the Builtin Private Actions within your controllers as well. Default actions will override the ones in lower level controllers/global, while begin/end actions will be chained together, so if you have a default action in MyApp::C::Foo::Bar as well as a global one, and a global begin/end, as well as a begin end in MyApp::C::Foo and MyApp::C::Foo::Bar, the components will be called as follows: +You can define the Builtin Private Actions within your controllers as +well. The actions will override the ones in lower level controllers/ +global. + +In addition to the normal builtins, you have a special action for +making inheritance chains, 'auto'. These will be run after begin, +but before your action is processed. =over 4 =item for a request for /foo/foo MyApp::begin + MyApp::auto MyApp::default MyApp::end =item for a request for /foo/bar/foo - MyApp::begin - MyApp::C::Foo::begin MyApp::C::Foo::Bar::begin + MyApp::auto + MyApp::C::Foo::auto MyApp::C::Foo::Bar::default MyApp::C::Foo::Bar::end - MyApp::C::Foo::end - MyApp::end + +=back + +Also, if you need to break out of the chain in one of your auto +actions, you can return 0, if so, your action will not be processed, +but the end will, so for the request above, if the first auto returns +false, it would look like this: + +=over 4 + +=item for a request for /foo/bar/foo where auto returns false + + MyApp::C::Foo::Bar::begin + MyApp::auto + MyApp::C::Foo::Bar::end =back