protected function output($message = '') { if (is_numeric($message)) { echo $message; exit; } else { header('Content-type: application/json; charset=' . Windid::client()->clientCharser); echo WindJson::encode($message, Windid::client()->clientCharser); exit; } }
/** * 将数据用json加密 * * @param mixed $value 需要加密的数据 * @param string $charset 字符编码 * @return string 加密后的数据 */ public static function jsonEncode($value) { return WindJson::encode($value, Wekit::V('charset')); }
protected function output($message = '') { header('Content-type: application/json'); echo WindJson::encode($message, Windid::client()->clientCharser); exit; }
/** * 输出json到页面 * 添加转义 * * @param mixed $source * @param string $charset * @return string */ public static function escapeEncodeJson($source, $charset = 'utf-8') { return WindJson::encode(is_string($source) ? self::escapeHTML($source) : self::escapeArrayHTML($source), $charset); }
/** * 将数据用json加密 * * @param mixed $value 需要加密的数据 * @param string $charset 字符编码 * @return string 加密后的数据 */ public static function jsonEncode($value) { return WindJson::encode($value, Wekit::app()->charset); }
/** * 将数据用json加密 * * @param mixed $value 需要加密的数据 * @param string $charset 字符编码 * @return string 加密后的数据 */ public static function jsonEncode($value, $charset = self::UTF8) { Wind::import('Wind:utility.WindJson'); return WindJson::encode($value, $charset); }