CJavaScriptExpression
| 包 | system.web.helpers |
|---|---|
| 继承 | class CJavaScriptExpression |
| 可用自 | 1.1.11 |
| 源码 | framework/web/helpers/CJavaScriptExpression.php |
CJavaScriptExpression represents a JavaScript expression that does not need escaping.
It can be passed to CJavaScript::encode() and the code will stay as is.
公共属性
| 属性 | 类型 | 描述 | 被定义在 |
|---|---|---|---|
| code | string | the javascript expression wrapped by this object | CJavaScriptExpression |
公共方法
| 方法 | 描述 | 被定义在 |
|---|---|---|
| __construct() | CJavaScriptExpression | |
| __toString() | String magic method | CJavaScriptExpression |
属性详情
code
属性
public string $code;
the javascript expression wrapped by this object
方法详情
__construct()
方法
|
public void __construct(string $code)
| ||
| $code | string | a javascript expression that is to be wrapped by this object |
源码: framework/web/helpers/CJavaScriptExpression.php#30 (显示)
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;
}
__toString()
方法
|
public string __toString()
| ||
| {return} | string | the javascript expression wrapped by this object |
源码: framework/web/helpers/CJavaScriptExpression.php#43 (显示)
public function __toString()
{
return $this->code;
}
String magic method