diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-22 09:14:12 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-22 09:14:12 +0100 |
commit | 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b (patch) | |
tree | e870d29e21c14d5b1683d638dff978afe0a104fa /framework/Web/Javascripts/TJavaScriptString.php | |
parent | 53e4cd65205ac33d7dbc61a767f467c1b896dfc6 (diff) |
Apply namespaces to class inheritances (pt1)
Diffstat (limited to 'framework/Web/Javascripts/TJavaScriptString.php')
-rw-r--r-- | framework/Web/Javascripts/TJavaScriptString.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/TJavaScriptString.php b/framework/Web/Javascripts/TJavaScriptString.php new file mode 100644 index 00000000..826ea28f --- /dev/null +++ b/framework/Web/Javascripts/TJavaScriptString.php @@ -0,0 +1,31 @@ +<?php +/** + * TComponent, TPropertyValue classes + * + * @author Qiang Xue <qiang.xue@gmail.com> + * + * Global Events, intra-object events, Class behaviors, expanded behaviors + * @author Brad Anderson <javalizard@mac.com> + * + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package Prado\Web\Javascripts + */ + +namespace Prado\Web\Javascripts; + +/** + * TJavaScriptString class is an internal class that marks strings that will be + * forcibly encoded when rendered inside a javascript block + * + * @package Prado\Web\Javascripts + * @since 3.2.0 + */ +class TJavaScriptString extends TJavaScriptLiteral +{ + public function toJavaScriptLiteral() + { + return TJavaScript::jsonEncode((string)$this->_s,JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG); + } +}
\ No newline at end of file |