Text::Xslate::Bridge::TT2Like - TT2 Variable Method Clone For Text::Xslate
use Text::Xslate; my $xslate = Text::Xslate->new( module => [ 'Text::Xslate::Bridge::TT2Like' ], ); # Note that all methods require a set of parenthesis to be # recognized as a method. $xslate->render_string( '<: $foo.length() :>', { foo => "foo" } ); $xslate->render_string( '<: $foo.replace("foo", "bar") :>', { foo => "foo" } );
Text::Xslate::Bridge::TT2Like exports Template-Toolkit variable methods into Text::Xslate namespace, such that you can use them on your variables.
The only difference between this module and Text::Xslate::Bridge::TT2 is that Bridge::TT2 uses Template::Toolkit underneath, while this module is independent of Template::Toolkit and therefore does not require TT to be installed
Original code was taken from Template::VMethods, Template::Filters by Andy Wardley.
Copyright (c) 2010 Daisuke Maki <daisuke@endeworks.jp>
<daisuke@endeworks.jp>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Text::Xslate::Bridge::TT2Like, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Xslate::Bridge::TT2Like
CPAN shell
perl -MCPAN -e shell install Text::Xslate::Bridge::TT2Like
For more information on module installation, please visit the detailed CPAN module installation guide.