***** DESCRIPTION Mojolicous::Plugin::Mason1Renderer is a renderer for Mason 1 (aka HTML::Mason 1.x) template system, plugabble into Mojolicious web framework. Mojolicious : http://www.mojolicious.org/ http://search.cpan.org/~kraih/Mojolicious/ HTML::Mason (1) : http://www.masonhq.com/ http://search.cpan.org/~drolsky/HTML-Mason/ ***** SYNOPSIS ## Mojolicious::Lite # example -1- use Mojolicious::Lite; plugin 'mason1_renderer'; get '/' => sub { my $self = shift; $self->render('/index', handler => "mason" ); }; app->start; # template: MOJO_HOME/mason/index
Welcome # example -2- use Mojolicious::Lite; plugin 'mason1_renderer' => { interp_params => { comp_root => "/path/to/mason/comps", ... (other parameters to the new() HTML::Mason::Interp constructor) }, request_params => { error_format => "brief", ... (other parameters to the new() HTML::Mason::Request constructor) }, }; get '/' => sub { my $self = shift; $self->render('/index', handler => "mason", mytext => "Hello world" ); }; app->start; # template: /path/to/mason/comps/index <%args> $mytext => undef %args> Welcome : <% $mytext %> ## Mojolicious # example -1- package MyApp; use Mojo::Base 'Mojolicious'; sub startup { my $self = shift; $self->plugin('mason1_renderer'); $self->routes->get('/' => sub { my $self = shift; $self->render('/index', handler => "mason" ); } ); } 1; # template: MOJO_HOME/mason/index Welcome # example -2- package MyApp; use Mojo::Base 'Mojolicious'; sub startup { my $self = shift; $self->plugin('mason1_renderer', { interp_params => { comp_root => "/path/to/mason/comps", ... (other parameters to the new() HTML::Mason::Interp constructor) }, request_params => { error_format => "brief", ... (other parameters to the new() HTML::Mason::Request constructor) }, } ); $self->routes->get('/' => sub { my $self = shift; $self->render('/index', handler => "mason", mytext => "Hello World" ); } ); } 1; # template: /path/to/mason/comps/index <%args> $mytext => undef %args> Welcome : <% $mytext %>