Thursday, April 24, 2008

Creating a controller in Catalyst

A new controller in Catalyst is registered by running script/APPNAME_create.pl CONTROLLER_NAME. This creates a module in the controller directory and a test in the test directory. These are apparently all that is needed for a controller to be created.

It's worth noting that /foo can activate either App::Controller::Foo::index() or App::Controller::Root::foo(). However, if both exist, App::Controller::Foo::index() takes precedence.

No comments: