https://github.com/kelp-framework/module-template-toolkit
Template::Toolkit adapter for Kelp
https://github.com/kelp-framework/module-template-toolkit
hacktoberfest perl perl-kelp
Last synced: 26 days ago
JSON representation
Template::Toolkit adapter for Kelp
- Host: GitHub
- URL: https://github.com/kelp-framework/module-template-toolkit
- Owner: Kelp-framework
- Created: 2013-06-12T19:30:46.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2019-01-25T18:37:49.000Z (over 7 years ago)
- Last Synced: 2025-12-13T06:45:20.033Z (6 months ago)
- Topics: hacktoberfest, perl, perl-kelp
- Language: Perl
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# NAME
Kelp::Module::Template::Toolkit - Template::Toolkit processing for Kelp applications
# SYNOPSIS
First ...
```perl
# conf/config.pl
{
modules => ['Template::Toolkit'],
modules_init => {
'Template::Toolkit' => { ... }
}
};
```
Then ...
```perl
# lib/MyApp.pm
sub some_route {
my $self = shift;
$self->template('some_template', { bar => 'foo' });
}
```
# DESCRIPTION
This module provides an interface for using [Template](http://search.cpan.org/perldoc?Template) inside a Kelp web application.
# REGISTERED METHODS
## template
`template($filename, \%vars)`
Renders a file using the currently loaded template engine.
# PERKS
## UTF8
[Template](http://search.cpan.org/perldoc?Template) is sometimes unable to detect the correct encoding, so to ensure
proper rendering, you may want to add `ENCODING` to its configuration:
```perl
# conf/config.pl
{
modules => ['Template::Toolkit'],
modules_init => {
'Template::Toolkit' => {
ENCODING => 'utf8'
}
}
};
```