Skip to content

Commit 2b6ac41

Browse files
author
Stefan Geneshky
committed
Update README
1 parent 945c79b commit 2b6ac41

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

README.md

+57-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,58 @@
1-
kelp-module-template-toolkit
2-
============================
1+
# NAME
32

4-
Template module for Kelp
3+
Kelp::Module::Template::Toolkit - Template::Toolkit processing for Kelp applications
4+
5+
# SYNOPSIS
6+
7+
First ...
8+
9+
```perl
10+
# conf/config.pl
11+
{
12+
modules => ['Template::Toolkit'],
13+
modules_init => {
14+
'Template::Toolkit' => { ... }
15+
}
16+
};
17+
```
18+
19+
Then ...
20+
21+
```perl
22+
# lib/MyApp.pm
23+
sub some_route {
24+
my $self = shift;
25+
$self->template('some_template', { bar => 'foo' });
26+
}
27+
```
28+
29+
# DESCRIPTION
30+
31+
This module provides an interface for using [Template](http://search.cpan.org/perldoc?Template) inside a Kelp web application.
32+
33+
# REGISTERED METHODS
34+
35+
## template
36+
37+
`template($filename, \%vars)`
38+
39+
Renders a file using the currently loaded template engine.
40+
41+
# PERKS
42+
43+
## UTF8
44+
45+
[Template](http://search.cpan.org/perldoc?Template) is sometimes unable to detect the correct encoding, so to ensure
46+
proper rendering, you may want to add `ENCODING` to its configuration:
47+
48+
```perl
49+
# conf/config.pl
50+
{
51+
modules => ['Template::Toolkit'],
52+
modules_init => {
53+
'Template::Toolkit' => {
54+
ENCODING => 'utf8'
55+
}
56+
}
57+
};
58+
```

0 commit comments

Comments
 (0)