The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CatalystX::Controller::Pluggable

VERSION

version 0.02

SYNOPSIS

In your controller...

 BEGIN{ extends 'CatalystX::Controller::Pluggable' }

And write a plugin..

 package Some::Path::To::Plugins::Example;
 use Moose::Role;
 
 before 'view' => sub { 
   my( $self, $c ) = @_;
   $c->log->debug('About to call view..');
 };

 1;

DESCRIPTION

This just uses Module::Pluggabe::Object to apply some roles at runtime to a Catalyst controller. Nothing special.

Assuming an application name MyApp and a controller TestController, plugins are searched for by default in MyApp::Plugins::TestController. This behaviour may be changed by setting the plugin_path attribute in your controller:

 has 'plugin_path' => ( 
   is => 'rw',
   default => 'Somewhere::Else::To::Search'
 );

The value is simply passed to Module::Pluggable::Object's search_path with no checking done.

BUGS

Prolly.

AUTHOR

Dave Houston dhouston@cpan.org

COPYRIGHT AND LICENSE

Copyright 2010, Dave Houston

This program is free software; you can redistribute and/or modify it under the same terms as Perl itself.