Prado\Web\Javascripts\TJavaScript::quoteJsLiteral PHP Метод

quoteJsLiteral() публичный статический Метод

public static quoteJsLiteral ( $js ) : Marks
Результат Marks a string as a javascript function. Once marke, the string is considered as a raw javascript function that is not supposed to be encoded by {@link encode}
    public static function quoteJsLiteral($js)
    {
        if ($js instanceof TJavaScriptLiteral) {
            return $js;
        } else {
            return new TJavaScriptLiteral($js);
        }
    }

Usage Example

Пример #1
0
 /**
  * Adds on client-side event handler by wrapping the code within a
  * javascript function block. If the code begins with "javascript:", the
  * code is assumed to be a javascript function block rather than arbiturary
  * javascript statements.
  * @param string option name
  * @param string javascript statements.
  */
 protected function setFunction($name, $code)
 {
     if (!TJavaScript::isJsLiteral($code)) {
         $code = TJavaScript::quoteJsLiteral($this->ensureFunction($code));
     }
     $this->setOption($name, $code);
 }
All Usage Examples Of Prado\Web\Javascripts\TJavaScript::quoteJsLiteral