Exemple #1
0
 /**
  * 格式化属性
  *
  * @param array $attribs
  */
 function _formatAttribs(&$attribs)
 {
     // 格式化参数
     foreach ($attribs as $option => $value) {
         if (!isset($this->paramsType[$option])) {
             $type = 'object';
         } else {
             $type = $this->paramsType[$option];
         }
         switch ($type) {
             case 'raw':
             case 'function':
             case 'number':
                 break;
             case 'pair':
                 if (is_array($value)) {
                     $value = t2js(encode_url_args($value));
                 }
                 break;
             case 'boolean':
                 $value = $value ? 'true' : 'false';
                 break;
             case 'object':
                 $value = "\$(\"{$value}\")";
                 break;
             case 'string':
             default:
                 $value = '"' . t2js($value) . '"';
         }
         $attribs[$option] = $value;
     }
 }
Exemple #2
0
 /**
  * 设置返回点 URL,稍后可以用 _goBack() 返回
  */
 function _setBack()
 {
     $_SESSION['BACKURL'] = encode_url_args($_GET);
 }