Catalyst::Plugin::ConfigComponents - Creates components from config entries
# In your Catalyst application package YourApp; use Catalyst qw(ConfigComponents); __PACKAGE__->setup; # In your applications config file <component name="Model::YourModel"> <parent_classes>YourExternal::ModelE<lt>/parent_classes> <parent_classes>Catalyst::ModelE<lt>/parent_classes> </component> # 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( ... );
This documents version v0.9.$Rev: 1 $ of Catalyst::Plugin::ConfigComponents
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
Specify a Plugin::ConfigComponents config option. Attributes are
component_active
If the component_active config attribute exists and is false the component will not be loaded
parent_classes
List of classes for the derived component to inherit from
search_extra
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
::
setup_method
Defaults to _setup_config_components, the method to call after the call to Catalyst::setup_components
_setup_config_components
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
\A Model|View|Controller ::
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)
MyApp->config->{ $component }->{parent_classes}
Catalyst::$component
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Catalyst-Plugin-ConfigComponents. Patches are welcome
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
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
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
To install Catalyst::Plugin::ConfigComponents, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::ConfigComponents
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::ConfigComponents
For more information on module installation, please visit the detailed CPAN module installation guide.