Versions
Look up a class, method, property or event

CJavaScriptExpression

Package system.web.helpers
Inheritance class CJavaScriptExpression
Since 1.1.11
Source Code 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.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
code string the javascript expression wrapped by this object CJavaScriptExpression

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() CJavaScriptExpression
__toString() String magic method CJavaScriptExpression

Property Details

code property
public string $code;

the javascript expression wrapped by this object

Method Details

__construct() method
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;
}

__toString() method
public string __toString()
{return} string the javascript expression wrapped by this object
Source Code: framework/web/helpers/CJavaScriptExpression.php#43 (show)
public function __toString()
{
    return 
$this->code;
}

String magic method

Be the first person to leave a comment

Please to leave your comment.