NAME

CatalystX::ComponentsFromConfig::Role::PluginRole - parameterised role for plugins to create components from configuration

VERSION

version 1.0

DESCRIPTION

Here we document implementation details, see CatalystX::ComponentsFromConfig::ModelPlugin and CatalystX::ComponentsFromConfig::ViewPlugin for usage examples.

METHODS

setup_components

after the normal Catalyst components setup, call _setup_dynamic_${component_type}.

_setup_dynamic_${component_type}

Loops through $app->config, looking for sections that don't correspond to existing components. For each one, uses CatalystX::InjectComponent to create the component, using as base class either the one set globally in the ${component_type}_from_config section (key base_class), or the one set locally in the base_class value. If neither is set, the default CatalystX::ComponentsFromConfig::${component_type}Adaptor is used.

ROLE PARAMETERS

component_type

One of 'model', 'view', 'controller'. There is no pre-packaged plugin to create controllers, mostly because I could not think of a sensible adaptor for them.

AUTHORS

  • Tomas Doran (t0m) <bobtfish@bobtfish.net>

  • Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Net-a-porter.com.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.