| 1 | package Kelp::Module::Template::Xslate; | ||||||||||
| 2 | 1 | ▶ | use Kelp::Base 'Kelp::Module::Template'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Text::Xslate; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = 0.01; | |||||||||
| 6 | |||||||||||
| 7 | 1 | attr ext => 'tx'; | |||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | sub build_engine { | ||||||||
|
Subroutine
build_engine: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 10 | 1 | my ( $self, %args ) = @_; | |||||||||
| 11 | 1 | Text::Xslate->new(%args); | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | 2 | ▶ | sub render { | ||||||||
|
Subroutine
render: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | 2 | my ( $self, $template, $vars ) = @_; | |||||||||
| 16 | return | ||||||||||
| 17 | 2 | ▶ | ref($template) eq 'SCALAR' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | ? $self->engine->render_string( $$template, $vars ) | ||||||||||
| 19 | : $self->engine->render( $template, $vars ); | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 1 | 1; | |||||||||
| 23 | |||||||||||
| 24 | __END__ | ||||||||||