Skip to content

Kelp-framework/Module-Template-Toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Kelp::Module::Template::Toolkit - Template::Toolkit processing for Kelp applications

SYNOPSIS

First ...

# conf/config.pl
{
    modules => ['Template::Toolkit'],
    modules_init => {
        'Template::Toolkit' => { ... }
    }
};

Then ...

# lib/MyApp.pm
sub some_route {
    my $self = shift;
    $self->template('some_template', { bar => 'foo' });
}

DESCRIPTION

This module provides an interface for using Template inside a Kelp web application.

REGISTERED METHODS

template

template($filename, \%vars)

Renders a file using the currently loaded template engine.

PERKS

UTF8

Template is sometimes unable to detect the correct encoding, so to ensure proper rendering, you may want to add ENCODING to its configuration:

# conf/config.pl
{
    modules      => ['Template::Toolkit'],
    modules_init => {
        'Template::Toolkit' => {
            ENCODING => 'utf8'
        }
    }
};

Languages