-
-
15 Nov 2012 09:06:21 UTC
- Distribution: Text-Xslate-Syntax-HTMLTemplate
- Module version: 0.1005
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (580 / 15 / 1)
- Kwalitee
Bus factor: 0- 87.50% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (28.48KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Shigeki Morimoto <Shigeki(at)Morimo.to>
- Dependencies
- HTML::Template::Parser
- HTML::Template::Pro
- Text::Xslate
- YAML
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
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'); For Migration test: Text::Xslate::Syntax::HTMLTemplate::install_Xslate_as_HTMLTemplate(); my $htp = HTML::Template::Pro->new(...); ... my $output = $htp->output(); # generated by xsalte engine; my $output_htp = $htp->output_original_HTMLTemplate(); # generated by HTML::Template::Pro; diff($output, $output_htp);
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.
is_escaped_var
-
Method that determine var is escaped or not. For temporary use while migration. You should use Text::Xslate::mark_raw().
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.
Module Install Instructions
To install Text::Xslate::Syntax::HTMLTemplate, copy and paste the appropriate command in to your terminal.
cpanm Text::Xslate::Syntax::HTMLTemplate
perl -MCPAN -e shell install Text::Xslate::Syntax::HTMLTemplate
For more information on module installation, please visit the detailed CPAN module installation guide.