system system.base system.caching system.caching.dependencies system.collections system.console system.db system.db.ar system.db.schema system.db.schema.cubrid system.db.schema.mssql system.db.schema.mysql system.db.schema.oci system.db.schema.pgsql system.db.schema.sqlite system.gii system.i18n system.i18n.gettext system.logging system.test system.utils system.validators system.web system.web.actions system.web.auth system.web.filters system.web.form system.web.helpers system.web.renderers system.web.services system.web.widgets system.web.widgets.captcha system.web.widgets.pagers zii.behaviors zii.widgets zii.widgets.grid zii.widgets.jui

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