1 package Maypole::View::Mason;
2 use base 'Maypole::View::Base';
9 my $mason = HTML::Mason::Interp->new(
10 comproot => [ map { [ $label++ => $_ ] } $self->paths($t) ],
11 output_method => \$output,
12 error_mode => "output" # Saves us having to handle them...
14 $mason->exec($r->template, $self->vars($r))
15 $r->{output} = $output;
23 Maypole::View::Mason - A HTML::Mason view class for Maypole
27 BeerDB->config->{view} = "Maypole::View::Mason";
35 % for my $brewery (@breweries) {
37 <TD><% $brewery->name %></TD>
43 This class allows you to use C<HTML::Mason> components for your Maypole
44 templates. It provides precisely the same path searching and template
45 variables as the Template Toolkit view class, although you will need
46 to produce your own set of templates as the factory-supplied templates
47 are, of course, Template Toolkit ones.
49 Please see the Maypole manual, and in particular, the C<View> chapter,
50 for the template variables available and for a refresher on how template
51 components are resolved.
59 This module was made possible thanks to a Perl Foundation grant.