mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-05 07:44:05 +01:00
added CJavaScriptExpression while keeping BC
This commit is contained in:
40
framework/web/helpers/CJavaScriptExpression.php
Normal file
40
framework/web/helpers/CJavaScriptExpression.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* CJavaScriptExpression class file.
|
||||
*
|
||||
* @author Alexander Makarov <sam@rmcreative.ru>
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright © 2012 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
/**
|
||||
* CJavaScriptExpression represents a JavaScript expression that does not need escaping.
|
||||
* It can be passed to {@link CJavaScript::encode()} and the code will stay as is
|
||||
* no matter if $safe set to true or not.
|
||||
*
|
||||
* @author Alexander Makarov <sam@rmcreative.ru>
|
||||
* @package system.web.helpers
|
||||
* @since 1.1.11
|
||||
*/
|
||||
class CJavaScriptExpression
|
||||
{
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @param $code
|
||||
*/
|
||||
public function __construct($code)
|
||||
{
|
||||
$this->code=$code;
|
||||
}
|
||||
|
||||
/**
|
||||
* String magic method
|
||||
* @return string the DB expression
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user