NAME

Eve::Template - a template engine class.

SYNOPSIS

my $template = Eve::Template->new(
    path => '/some/include/path',
    compile_path => '/some/compile/path',
    expiration_interval => 60);

my $output = $template->process(
    file => 'helloworld.html',
    var_hash => $var_hash);

DESCRIPTION

Eve::Template is a template engine adapter class. It adapts well known Template package.

Constructor arguments

path

a path to template files

compile_path

a path where compiled template files will be stored

expiration_interval

determines how long (in seconds) a template is keeping cached in memory before checking if it is changed

var_hash

an optional hash of variables that will be additionally made available to all processed templates.

Throws

Eve::Error::Template

when the template creation was unsuccessful.

METHODS

init()

process()

Process the template.

Arguments

file

a template file to process

var_hash

a variables hash to be used in the template.

Returns

A text assembled after processing.

Throws

Eve::Error::Template

when the processing was unsuccessful.

SEE ALSO

Eve::Class
Eve::Exception
Template

LICENSE AND COPYRIGHT

Copyright 2012 Igor Zinovyev.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

AUTHOR

Sergey Konoplev