Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Adding controllers to an app from a plugin

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


evdb at ecclestoad

Nov 7, 2009, 12:06 PM

Post #1 of 2 (184 views)
Permalink
Adding controllers to an app from a plugin

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)?

Cheers,
Edmund.

* 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

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

Nov 7, 2009, 1:25 PM

Post #2 of 2 (159 views)
Permalink
Re: Adding controllers to an app from a plugin [In reply to]

On 7 Nov 2009, at 20:06, Edmund von der Burg wrote:
> 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)?

You're after CatalystX::InjectComponent

Cheers
t0m


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.