Gianni Ceccarelli > CatalystX-ComponentsFromConfig-1.004 > CatalystX::ComponentsFromConfig::ViewAdaptor

Download:
CatalystX-ComponentsFromConfig-1.004.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.004   Source   Latest Release: CatalystX-ComponentsFromConfig-1.005

NAME ^

CatalystX::ComponentsFromConfig::ViewAdaptor - trait-aware adaptor for Views

VERSION ^

version 1.004

SYNOPSIS ^

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:

  my $obj = My::Class->new({some=>'param'});
  apply_all_roles($obj,'My::Special::Role');

DESCRIPTION ^

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.

AUTHORS ^

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.

syntax highlighting: