| 1 | package Kelp::Module::Template::XslateTT; | ||
| 2 | |||
| 3 | # $Id: XslateTT.pm 66 2018-11-21 18:22:53Z stro $ | ||
| 4 | |||
| 5 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 3 | ▶ | use Kelp::Base 'Kelp::Module::Template::Xslate'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | ▶ | use Text::Xslate; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 3 | our $VERSION = 1.002; | |
| 12 | |||
| 13 | 3 | attr ext => 'tt'; | |
| 14 | |||
| 15 | 1 | ▶ | sub build_engine { |
|
Subroutine
build_engine: called CC=1 SCAR=0.0
Pod
documented
| |||
| 16 | 1 | my ($self, %args) = @_; | |
| 17 | 1 | $args{'syntax'} = 'TTerse'; | |
| 18 | 1 | $args{'suffix'} = '.tt'; | |
| 19 | 1 | Text::Xslate->new(%args); | |
| 20 | } | ||
| 21 | |||
| 22 | =head1 NAME | ||
| 23 | |||
| 24 | Kelp::Module::Template::XslateTT - process .tt files with Text::Xslate | ||
| 25 | |||
| 26 | =head1 SYNOPSIS | ||
| 27 | |||
| 28 | config.yml: | ||
| 29 | |||
| 30 | modules: | ||
| 31 | Template::XslateTT | ||
| 32 | modules_init: | ||
| 33 | Template::XslateTT: | ||
| 34 | path: | ||
| 35 | - ./views | ||
| 36 | - ../views | ||
| 37 | |||
| 38 | config.pl: | ||
| 39 | |||
| 40 | 'modules' => [ qw/ Template::XslateTT / ], | ||
| 41 | 'modules_init' => { | ||
| 42 | 'Template::XslateTT' => { | ||
| 43 | 'path' => [ | ||
| 44 | './views', | ||
| 45 | '../views', | ||
| 46 | ], | ||
| 47 | }, | ||
| 48 | }, | ||
| 49 | |||
| 50 | =head1 DESCRIPTION | ||
| 51 | |||
| 52 | Kelp::Module::Template::XslateTT is a drop-in replacement for Template-Tiny and Template-Toolkit engines in Kelp. | ||
| 53 | It allows to use faster Xslate template engine without modifying your templates, renaming files, or changing the code. | ||
| 54 | All you need is changing a few lines in your Kelp config file. | ||
| 55 | |||
| 56 | =head1 VERSION | ||
| 57 | |||
| 58 | 1.002 | ||
| 59 | |||
| 60 | =head1 AUTHOR | ||
| 61 | |||
| 62 | (c) 2018 Serguei Trouchelle E<lt>stro@cpan.orgE<gt>. | ||
| 63 | |||
| 64 | =head1 LICENCE | ||
| 65 | |||
| 66 | This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||
| 67 | |||
| 68 | =head1 SEE ALSO | ||
| 69 | |||
| 70 | L<Kelp>, | ||
| 71 | L<Text::Xslate>, | ||
| 72 | L<Kelp::Module::Template::Xslate> | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | 3 | 1; | |