Tina Müller > HTML-Template-Compiled-1.000_006 > HTML::Template::Compiled::Formatter

Download:
HTML-Template-Compiled-1.000_006.tar.gz

Dependencies

Annotate this POD (2)

CPAN RT

Open  2
View/Report Bugs
Module Version: 0.01   Source   Latest Release: HTML-Template-Compiled-1.001_001

NAME ^

HTML::Template::Compiled::Formatter - HTC subclass for using a formatter

SYNOPSIS ^

    my $formatter = {
        'HTC::Class1' => {
            fullname => sub {
                $_[0]->first . ' ' . $_[0]->last
            },
            first => HTC::Class1->can('first'),
            last => HTC::Class1->can('last'),
        },
    };
    my $htc = HTML::Template::Compiled::Formatter->new(
        path => 't/templates',
        filename => 'formatter.htc',
        debug => 0,
    );
    my $obj = bless ({ first => 'Abi', last => 'Gail'}, 'HTC::Class1');

    $htc->param(
        test => 23,
        obj => $obj,
    );
    local $HTML::Template::Compiled::Formatter::formatter = $formatter;
    my $out = $htc->output;
syntax highlighting: