Class for Zend_Json encode method.
This class simply holds a string with a native Javascript Expression, so objects | arrays to be encoded with Zend_Json can contain native Javascript Expressions.
Example:
$foo = array(
'integer' =>9,
'string' =>'test string',
'function' => Zend_Json_Expr(
'function(){ window.alert("javascript function encoded by Zend_Json") }'
),
);
Zend_Json::encode($foo, false, array('enableJsonExprFinder' => true)); // it will returns json encoded string: // {"integer":9,"string":"test string","function":function(){window.alert("javascript function encoded by Zend_Json")}}
category | Zend |
---|---|
package | Zend_Json |
subpackage | Expr |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
__construct(string $expression) : void
string
the expression to hold.
__toString() : string
string
holded javascript expression.$_expression : string