CatalystX::DynamicComponent::ModelsFromConfig - Generate simple Catalyst::Model::Adaptor like models purely from application config.
package MyApp; use Moose; use namespace::autoclean; use Catalyst qw/ +CatalystX::DynamicComponent::ModelsFromConfig /; __PACKAGE__->config( name => __PACKAGE__, 'CatalystX::DynamicComponent::ModelsFromConfig' => { include => '(One|Two|Three)^', exclude => 'Tewnty', }, 'Model::One' => { class => 'SomeClass', # Name of class to load and construct other => 'config', # Constructor passed other parameters }, 'Model::Two' => { class => 'SomeOtherClass', other => 'config', }, ... 'Model::TwentyThree' => { # Ignored, as excluded ... ); __PACKAGE__->setup;
FIXME
Catalyst, MooseX::MethodAttributes, CatalystX::DynamicComponent.
Probably plenty, test suite certainly isn't comprehensive.. Patches welcome.
Tomas Doran (t0m) <bobtfish@bobtfish.net>
This code is copyright (c) 2009 Tomas Doran. This code is licensed on the same terms as perl itself.
To install CatalystX::DynamicComponent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::DynamicComponent
CPAN shell
perl -MCPAN -e shell install CatalystX::DynamicComponent
For more information on module installation, please visit the detailed CPAN module installation guide.