The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::View::MicroMason - MicroMason View Class

SYNOPSIS

    # use the helper
    script/create.pl view MicroMason MicroMason

    # lib/MyApp/View/MicroMason.pm
    package MyApp::View::MicroMason;

    use base 'Catalyst::View::MicroMason';

    __PACKAGE__->config(
        # -Filters      : to use |h and |u
        # -ExecuteCache : to cache template output
        # -CompileCache : to cache the templates
        Mixins        => [qw( -Filters -CompileCache )], 
        template_root => '/path/to/comp_root'
    );


    1;
    
    # Meanwhile, maybe in an 'end' action
    $c->forward('MyApp::View::MicroMason');

DESCRIPTION

Want to use a MicroMason component in your views? No problem! Catalyst::View::MicroMason comes to the rescue.

CAVEATS

You have to define template_root. If template_root is not directly defined within config, the value comes from config-{root}>. If you don't define it at all, MicroMason is going to use the root of your system.

METHODS

process

Renders the component specified in $c->stash->{template} or $c->request->match to $c->response->output.

Note that the component name must be absolute, or is converted to absolute (ie, a / is added to the beginning if it doesn't start with one)

MicroMason global variables $base, $c and c<$name> are automatically set to the base, context and name of the app, respectively.

config

This allows your view subclass to pass additional settings to the Mason Text::MicroMason->new constructor.

SEE ALSO

Catalyst, Text::MicroMason

AUTHOR

Jonas Alves jgda@cpan.org

COPYRIGHT

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.