Created
October 8, 2010 09:24
-
-
Save nihen/616549 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Template---- | |
1-122 | |
2- | |
3-123 | |
Xslate/TTerse---- | |
Text::Xslate: Can't locate object method "moge" via package "Hash::MultiValue" at test.pl line 25. | |
(/home/chiba/tmp/tmpl/test.tt:1:&main[3]) at test.pl line 25 | |
eval {...} called at test.pl line 25 | |
---------------------------------------------------------------------------- | |
1-[% req.moge %] | |
2-[% req.get %] | |
---------------------------------------------------------------------------- | |
... exception cought on accessor ... (/home/chiba/tmp/tmpl/test.tt:1:&main[3]) at test.pl line 25 | |
---------------------------------------------------------------------------- | |
1-[% req.moge %] | |
2-[% req.get %] | |
---------------------------------------------------------------------------- | |
1- | |
2- | |
3-123 | |
Xslate/Kolon---- | |
Text::Xslate: Can't locate object method "moge" via package "Hash::MultiValue" at test.pl line 27. | |
("<string>":1:&main[3]) at test.pl line 27 | |
eval {...} called at test.pl line 27 | |
... exception cought on accessor ... ("<string>":1:&main[3]) at test.pl line 27 | |
1- | |
2- | |
3-123 |
This file contains hidden or 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
use 5.12.1; | |
use warnings; | |
use utf8; | |
use Text::Xslate; | |
use Template; | |
use Hash::MultiValue; | |
my $var = { req => Hash::MultiValue->new(get => '123', 'moge' => '122') }; | |
my $tt = Template->new({ | |
INCLUDE_PATH => 'tmpl', | |
}); | |
my $tx_tt = Text::Xslate->new( | |
path => 'tmpl', | |
syntax => 'TTerse', | |
); | |
my $tx_kolon = Text::Xslate->new( | |
path => 'tmpl', | |
); | |
say 'Template----'; | |
$tt->process('test.tt', $var); | |
say 'Xslate/TTerse----'; | |
say $tx_tt->render('test.tt', $var); | |
say 'Xslate/Kolon----'; | |
say $tx_kolon->render('test.tx', $var); |
This file contains hidden or 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
1-[% req.moge %] | |
2-[% req.get %] | |
3-[% req.get('get') %] |
This file contains hidden or 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
1-<: $req.moge :> | |
2-<: $req.get :> | |
3-<: $req.get('get') :> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment