NAME
Text::Xslate::Syntax::HTMLTemplate - An alternative syntax compatible with HTML Template
SYNOPSIS
use Text::Xslate;
local $Text::Xslate::Syntax::HTP::before_parse_hook = sub {
my $parser = shift;
$parser->use_global_vars(1);
$parser->use_loop_context_vars(1);
$parser->use_has_value(1);
};
my $tx = Text::Xslate->new(syntax => 'HTMLTemplate', compiler => 'Text::Xslate::Compiler::HTMLTemplate',
function => {
__choise_global_var__ => \&Text::Xslate::Syntax::HTMLTemplate::default_choise_global_var,
__has_value__ => \&Text::Xslate::Syntax::HTMLTemplate::default_has_value,
}
);
print $tx->render('hello.tx');
DESCRIPTION
Syntax::HTMLTemplate is a parser for Text::Xslate. It parse HTML::Template syntax template.
OPTIONS
use_global_vars
-
same as global_vars option of HTML::Template. you have to register function to handle that.
use_loop_context_vars
-
same as loop_context_vars option of HTML::Template.
use_has_value
-
HTML::Template treats empty array referense as Flase. But Xslate treats empty array referense as True. when use_has_value is seted, Syntax::HTMLTemplate you have to register function to handle that.
AUTHOR
Shigeki Morimoto <Shigeki(at)Morimo.to>
LICENSE AND COPYRIGHT
Copyright (c) 2011, Shigeki, Morimoto. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.