Class TJavaScriptLiteral
TJavaScriptLiteral class that encloses string literals that are not supposed to be escaped by TJavaScript::encode()
Since Prado 3.2 all the data that gets sent clientside inside a javascript statement is encoded by default to avoid any kind of injection. Sometimes there's the need to bypass this encoding and send raw javascript code. To ensure that a string doesn't get encoded by TJavaScript::encode() , construct a new TJavaScriptLiteral:
// a javascript test string $js="alert('hello')"; // the string in $raw will not be encoded when sent clientside inside a javascript block $raw=new TJavaScriptLiteral($js); // shortened form $raw=_js($js);
Direct known subclasses
TJavaScriptString
Package: System
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com> Global Events, intra-object events, Class behaviors, expanded behaviors
Author: Brad Anderson <javalizard@mac.com>
Since: 3.2.0
Located at TComponent.php
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com> Global Events, intra-object events, Class behaviors, expanded behaviors
Author: Brad Anderson <javalizard@mac.com>
Since: 3.2.0
Located at TComponent.php
public
|
|
public
|
|
public
|
protected
mixed
|
$_s |
|