[Catalyst] Very basic chained question

Tomas Doran bobtfish at bobtfish.net
Wed Jan 18 08:35:51 GMT 2012


On 18 Jan 2012, at 05:20, will trillich wrote:

> (Also read up on 'begin' and 'end' and 'auto' methods at http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Intro.pod#Built-in_special_actions.)

You shouldn't need begin or auto if you're using chained dispatch -  
given:

package MyApp::Controller::Root;

sub base : Chained('/') PathPart('') CaptureArgs(0) { # Top level auto  
or begin code here }

package MyApp::Controller::Foo;

sub base : Chained('/base') PathPart('foo') CaptureArgs(0) { #  
controller level auto or begin code here }

sub item : Chained('base') PathPart('') CaptureArgs(1) { # Grab <id>

sub show : Chained('item') PathPart('') Args(0) { # End of chain for / 
foo/<id>

Cheers
t0m




More information about the Catalyst mailing list