메소드 | 설명 | |
---|---|---|
JSMin ( $code ) : minimized | Minimize the size of a javascript script. | |
encode ( $value, $toMap = true, $encodeEmptyStrings = false ) : string | Encodes a PHP variable into javascript representation. | |
isFunction ( $js ) | Deprecated, use {@link isJsLiteral} instead | |
isJsLiteral ( $js ) : boolean | ||
jsonDecode ( $value, $assoc = false, $depth = 512 ) : mixed | Decodes a javascript string into PHP variable. | |
jsonEncode ( $value, $options ) : string | Encodes a PHP variable into javascript string. | |
quoteFunction ( $js ) | Deprecated, use {@link quoteJsLiteral} instead | |
quoteJsLiteral ( $js ) : Marks | ||
quoteString ( $js ) : string | Quotes a javascript string. | |
renderScriptBlock ( $script ) : string | Renders javascript block | |
renderScriptBlocks ( $scripts ) : string | Renders a list of javascript blocks | |
renderScriptBlocksCallback ( $scripts ) : string | Renders a list of javascript code | |
renderScriptFile ( $file ) : string | Renders a javascript file | |
renderScriptFiles ( $files ) : string | Renders a list of javascript files |
메소드 | 설명 | |
---|---|---|
checkJsonError ( ) | ||
convertToUtf8 ( string | array | mixed &$value, string $sourceEncoding ) | Encodes an string or the content of an array to UTF8 |
public static JSMin ( $code ) : minimized | ||
리턴 | minimized | version of the code |
$options['onLoading'] = "doit";
$options['onComplete'] = "more";
echo TJavaScript::encode($options);
expects the following javascript code
{'onLoading':'doit','onComplete':'more'}
For higher complexity data structures use {@link jsonEncode} and {@link jsonDecode}
to serialize and unserialize. public static isFunction ( $js ) |
public static isJsLiteral ( $js ) : boolean | ||
리턴 | boolean | true if the parameter is marked as a javascript function, i.e. if it's considered as a raw javascript function that is not supposed to be encoded by {@link encode} |
public static jsonDecode ( $value, $assoc = false, $depth = 512 ) : mixed | ||
리턴 | mixed | decoded variable |
public static jsonEncode ( $value, $options ) : string | ||
리턴 | string | encoded string |
public static quoteFunction ( $js ) |
public static quoteJsLiteral ( $js ) : Marks | ||
리턴 | Marks | a string as a javascript function. Once marke, the string is considered as a raw javascript function that is not supposed to be encoded by {@link encode} |
public static quoteString ( $js ) : string | ||
리턴 | string | the quoted string |
public static renderScriptBlock ( $script ) : string | ||
리턴 | string | rendering result |
public static renderScriptBlocks ( $scripts ) : string | ||
리턴 | string | rendering result |
public static renderScriptBlocksCallback ( $scripts ) : string | ||
리턴 | string | rendering result |
public static renderScriptFile ( $file ) : string | ||
리턴 | string | rendering result |
public static renderScriptFiles ( $files ) : string | ||
리턴 | string | rendering result |