GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Text::Xslate::Bridge::TT2Like(3) User Contributed Perl Documentation Text::Xslate::Bridge::TT2Like(3)

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

Upon loading Text::Xslate::Bridge::TT2Like, you will be able to use the following functions in your template. Please note that some functions like "uri" are available from Text::Xslate to start with, so we don't reimplment them. Check the manual for Text::Xslate for more info.

"item"
"list"
"hash"
"push"
"pop"
"unshift"
"shift"
"max"
"size"
"defined"
"first"
"last"
"reverse"
"grep"
"join"
"sort"
"nsort"
"unique"
"import"
"merge"
"slice"
"splice"

"html_para"
"html_break"
"html_para_break"
"html_line_break"
"xml"
"url"
"upper"
"lower"
"ucfirst"
"lcfirst"
"trim"
"null"
"collapse"
"indent"
"format"
"truncate"
"repeat"
"replace"
"remove"

"item"
"hash"
"size"
"each"
"keys"
"values"
"items"
"pairs"
"list"
"exists"
"defined"
"delete"
"import"
"sort"
"nsort"

"item"
"list"
"hash"
"length"
"size"
"defined"
"match"
"search"
"repeat"
"replace"
"remove"
"split"
"chunk"
"substr"

Original code was taken from Template::VMethods, Template::Filters by Andy Wardley.

Copyright (c) 2010 Daisuke Maki "<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

2011-09-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.