コード例 #1
0
ファイル: pradolite.php プロジェクト: tejdeeps/tejcs.com
 protected function setFunction($name, $code)
 {
     if (!TJavaScript::isJsLiteral($code)) {
         $code = TJavaScript::quoteJsLiteral($this->ensureFunction($code));
     }
     $this->setOption($name, $code);
 }
コード例 #2
0
ファイル: TComponent.php プロジェクト: tejdeeps/tejcs.com
 /**
  * Converts a value to string type.
  * Note, a boolean value will be converted to 'true' if it is true
  * and 'false' if it is false.
  * @param mixed the value to be converted.
  * @return string
  */
 public static function ensureString($value)
 {
     if (TJavaScript::isJsLiteral($value)) {
         return $value;
     }
     if (is_bool($value)) {
         return $value ? 'true' : 'false';
     } else {
         return (string) $value;
     }
 }