[Catalyst] Adding controllers to an app from a plugin

Edmund von der Burg evdb at ecclestoad.co.uk
Sat Nov 7 20:06:58 GMT 2009

Hello all.

I want to create a plugin that adds a controller to an app. From
looking at code on CPAN that does this* it seems that manually
creating controllers in the project that inherit from the one that is
provided by the plugin is the way to do it.

Another way to do it is to intercept the request in 'dispatch' and
take the appropriate action** - but I really don't like that at all.
For starters I want my controller to appear like all the others in the
debug output.

Is there already code on CPAN that helps me inject my plugin
controller into the app? Is there a better way to do this? Should I
rip out the smarts from C::P::AutoCRUD and make them reusable (and if
so what should it be called)?


* http://cpansearch.perl.org/src/OLIVER/Catalyst-Plugin-AutoCRUD-0.56/lib/Catalyst/Plugin/AutoCRUD.pm
** http://cpansearch.perl.org/src/AGRUNDMA/Catalyst-Plugin-UploadProgress-0.04/lib/Catalyst/Plugin/UploadProgress.pm

More information about the Catalyst mailing list