CJavaScriptExpression
CJavaScriptExpression represents a JavaScript expression that does not need escaping. It can be passed to
CJavaScript::encode() and the code will stay as is.
Public Properties
Property |
Type |
Description |
Defined By |
code | string | the javascript expression wrapped by this object | CJavaScriptExpression |
Property Details
public string $code;
the javascript expression wrapped by this object
Method Details
public void __construct(string $code) |
$code | string | a javascript expression that is to be wrapped by this object |
Source Code: framework/web/helpers/CJavaScriptExpression.php#30 (
show)
public function __construct($code)
{
if(!is_string($code))
throw new CException('Value passed to CJavaScriptExpression should be a string.');
if(strpos($code, 'js:')===0)
$code=substr($code,3);
$this->code=$code;
}
public string __toString() |
{return} | string | the javascript expression wrapped by this object |
String magic method