CatalystX::DynamicComponent::ModelsFromConfig::InterfaceRoles - Generate simple Catalyst::Model::Adaptor like models from application config, enforcing roles on the model classes.
package MyApp; use Moose; use namespace::autoclean; use Catalyst qw/ +CatalystX::DynamicComponent::ModelsFromConfig::InterfaceRoles /; __PACKAGE__->config( name => __PACKAGE__, 'CatalystX::DynamicComponent::ModelsFromConfig' => { include => 'One^', }, 'Model::One' => { class => 'SomeClass', # Name of class to load and construct other => 'config', # Constructor passed other parameters interface_roles => [qw/ My::Role /], # Your app explodes if SomeClass doesn't do My::Role }, ... ); __PACKAGE__->setup;
FIXME
CatalystX::DynamicComponent::ModelsFromConfig, CatalystX::DynamicComponent, Catalyst.
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.