ePages 7.27.0 - DE_EPAGES/TLE/API/JSONHandler.pm

Package DE_EPAGES::TLE::API::JSONHandler

This handler supports the following tle function:

Example
#FROM_JSON(#json)
#FROM_JSON(#hash)

Functions

FROM_JSON
JSON_ATTR
TO_JSON

FROM_JSON

Returns the hash object from json object.

Syntax
#FROM_JSON(#json);
Example
#FROM_JSON(#json)
Input
#json (string)
json
Return
#Hash (ref.hash)
hash

JSON_ATTR

Returns the json object from a hash or array reference. Also encodes the XML chacters &', so that the reuslt can be used within a single-quote delimited XML attribute.

Syntax
#JSON_ATTR(#Hash);
Example
<div id="mydata" data_js='#JSON_ATTR(#Hash)' />
Input
#Hash (ref.hash or ref.array)
hash
Return
#json (string)
json

TO_JSON

Returns the json object from a hash or array reference.

Syntax
#TO_JSON(#Hash);
Example
#TO_JSON(#Hash)
Input
#Hash (ref.hash or ref.array)
hash
Return
#json (string)
json