![]() |
![]()
| ![]() |
![]()
NAMETemplate::Plugin::JSON - Adds a .json vmethod for all TT values. VERSIONversion 0.08 SYNOPSIS[% USE JSON ( pretty => 1 ) %]; <script type="text/javascript"> var foo = [% foo.json %]; </script> or read in JSON [% USE JSON %] [% data = JSON.json_decode(json) %] [% data.thing %] DESCRIPTIONThis plugin provides a ".json" vmethod to all value types when loaded. You can also decode a json string back to a data structure. It will load the JSON::MaybeXS module, which will use Cpanel::JSON::XS when possible and fall back to JSON::PP otherwise. Any options on the USE line are passed through to the JSON object, much like "to_json" in Cpanel::JSON::XS. SEE ALSOJSON::MaybeXS, Template::Plugin SUPPORTBugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Template-Plugin-JSON> (or bug-Template-Plugin-JSON@rt.cpan.org <mailto:bug-Template-Plugin-JSON@rt.cpan.org>). AUTHORיובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org> CONTRIBUTORS
COPYRIGHT AND LICENCEThis software is Copyright (c) 2006 by Yuval Kogman. This is free software, licensed under: The MIT (X11) License
|