Created
November 17, 2011 09:33
-
-
Save ryochin/1372787 to your computer and use it in GitHub Desktop.
number str is treated as int with Xslate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -- | |
use strict; | |
use Text::Xslate; | |
my $xs = Text::Xslate->new( | |
syntax => 'TTerse', | |
); | |
my $template = <<'END'; | |
[%- MACRO foo(n) BLOCK -%] | |
<li>n is [% n %]</li> | |
[%- END # macro -%] | |
<ul> | |
[% foo("01") %] | |
[% foo("02") %] | |
[% foo("03") %] | |
</ul> | |
END | |
print $xs->render_string( $template, {} ); | |
__END__ | |
<ul> | |
<li>n is 1</li> | |
<li>n is 2</li> | |
<li>n is 3</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment