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->{Mixins} = [ qw( -TemplateDir ) ];
__PACKAGE__->config->{template_root} = '/servers/sites/MiniMojo/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 argument 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.