Dancer::Template::Mason2 - Mason 2.x wrapper for Dancer
version 0.04
# in 'config.yml' template: 'mason2' # in the app get '/foo', sub { template 'foo' => { title => 'bar' }; };
Then, in views/foo.mc:
views/foo.mc
<%args> $.title </%args> <h1><% $.title %></h1> <p>Mason says hi!</p>
This class is an interface between Dancer's template engine abstraction layer and the Mason 2.x templating system.
In order to use this engine, set the template to 'mason2' in the configuration file:
template: mason2
The default template extension is ".mc".
Parameters can also be passed to Mason->new via the configuration file, like so:
Mason->new
engines: mason2: data_dir: /path/to/data_dir
comp_root, if not specified, defaults to the views configuration setting or, if it's undefined, to the /views subdirectory of the application.
comp_root
views
/views
data_dir, if not specified, defaults to a /data subdirectory alongside the comp_root.
data_dir
/data
Dancer, Mason, Dancer::Template::Mason
Jonathan Swartz <swartz@pobox.com>
This software is copyright (c) 2011 by Jonathan Swartz.
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 Dancer::Template::Mason2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Template::Mason2
CPAN shell
perl -MCPAN -e shell install Dancer::Template::Mason2
For more information on module installation, please visit the detailed CPAN module installation guide.