Peter Flanigan > Catalyst-Plugin-ConfigComponents-0.9.1 > Catalyst::Plugin::ConfigComponents



Annotate this POD


View/Report Bugs
Module Version: v0.9.1   Source  

Name ^

Catalyst::Plugin::ConfigComponents - Creates components from config entries

Synopsis ^

   # In your Catalyst application
   package YourApp;

   use Catalyst qw(ConfigComponents);


   # In your applications config file
   <component name="Model::YourModel">

   # Do not create YourApp::Model::YourModel this module will do it for you

   # In a controller this will call your_method in
   # the class YourExternal::Model
   $result = $c->model( q(YourModel) )->your_method( ... );

Version ^

This documents version v0.9.$Rev: 1 $ of Catalyst::Plugin::ConfigComponents

Description ^

When the application starts this module creates Catalyst component class definitions using config information. The defined class inherits from the list of parent classes referenced in the config file

Configuration and Environment ^

Specify a Plugin::ConfigComponents config option. Attributes are


If the component_active config attribute exists and is false the component will not be loaded


List of classes for the derived component to inherit from


To add additional search paths, specify a key named search_extra as an array reference. Items in the array beginning with :: will have the application class name prepended to them


Defaults to _setup_config_components, the method to call after the call to Catalyst::setup_components

Subroutines/Methods ^


Calls the setup method (which defaults to "setup_config_components") after the parent method


For each config key matching \A Model|View|Controller :: it checks if the corresponding component already exists, and if it doesn't this method creates it at run-time

The parent class is set to MyApp->config->{ $component }->{parent_classes} if it exists, Catalyst::$component otherwise. The parent_classes can be an array ref in which case the defined class will inherit from all classes in the list (multiple inheritance)

Diagnostics ^


Dependencies ^


Incompatibilities ^

There are no known incompatibilities in this module

Bugs and Limitations ^

There are no known bugs in this module. Please report problems to Patches are welcome

Acknowledgements ^

Larry Wall - For the Perl programming language

This code was originally posted to the Catalyst mailing list by Dagfinn Ilmari Manns�ker as a patch in response to an idea by Castaway. I thought it would be better as a plugin and have extended it to handle MI

Author ^

Peter Flanigan, <>

License and Copyright ^

Copyright (c) 2013 Peter Flanigan. All rights reserved

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

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

syntax highlighting: