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