CatalystX::ComponentsFromConfig::ViewAdaptor - trait-aware adaptor for Views
version 1.006
In your application:
package My::App; use Catalyst qw( ConfigLoader +CatalystX::ComponentsFromConfig::ViewPlugin );
In your config:
<View::MyClass> class My::Class <args> some param </args> <traits> +My::Special::Role </traits> </View::MyClass>
Now, $c->view('MyClass') will contain an object built just like:
$c->view('MyClass')
my $obj = My::Class->new({some=>'param'}); apply_all_roles($obj,'My::Special::Role');
This plugin, built on CatalystX::ComponentsFromConfig::Role::AdaptorRole, adapts arbitrary classes to Catalyst views, and can also apply roles to them as specified in the configuration.
Tomas Doran (t0m) <bobtfish@bobtfish.net>
Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>
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.
To install CatalystX::ComponentsFromConfig, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::ComponentsFromConfig
CPAN shell
perl -MCPAN -e shell install CatalystX::ComponentsFromConfig
For more information on module installation, please visit the detailed CPAN module installation guide.