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

0.5.$Revision: 125 $

# In your Catalyst application
package YourApp;
use Catalyst qw(ConfigComponents);
__PACKAGE__->setup;
Class::C3::initialize();
# 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( ... );

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
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
You may want to add the line:
Class::C3::initialize();
to your Catalyst application after the __PACKAGE__->setup call if the base class creates any "diamond" patterns in the inheritance tree

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)

None


There are no known incompatibilities in this module

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

Peter Flanigan, <Support at RoxSoft.co.uk>

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

Copyright (c) 2008-2009 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