1Dancer2::Template::SimpUlsee(r3)Contributed Perl DocumenDtaantcieorn2::Template::Simple(3)
2
3
4
6 Dancer2::Template::Simple - Pure Perl 5 template engine for Dancer2
7
9 version 0.301004
10
12 To use this engine, you may configure Dancer2 via "config.yaml":
13
14 template: simple
15
17 This template engine is primarily to serve as a migration path for
18 users of Dancer. It should be fine for development purposes, but you
19 would be better served by using Dancer2::Template::TemplateToolkit or
20 one of the many alternatives available on CPAN to power an application
21 with Dancer2 in production environment.
22
23 "Dancer2::Template::Simple" is written in pure Perl and has no C
24 bindings to accelerate the template processing.
25
27 render($template, \%tokens)
28 Renders the template. The first arg is a filename for the template
29 file or a reference to a string that contains the template. The second
30 arg is a hashref for the tokens that you wish to pass to
31 Template::Toolkit for rendering.
32
34 A template written for "Dancer2::Template::Simple" should be working
35 just fine with Dancer2::Template::TemplateToolkit. The opposite is not
36 true though.
37
38 variables
39 To interpolate a variable in the template, use the following
40 syntax:
41
42 <% var1 %>
43
44 If var1 exists in the tokens hash given, its value will be written
45 there.
46
48 Dancer2, Dancer2::Core::Role::Template,
49 Dancer2::Template::TemplateToolkit.
50
52 Dancer Core Developers
53
55 This software is copyright (c) 2021 by Alexis Sukrieh.
56
57 This is free software; you can redistribute it and/or modify it under
58 the same terms as the Perl 5 programming language system itself.
59
60
61
62perl v5.34.0 2021-07-22 Dancer2::Template::Simple(3)