Location: PHPKode > projects > KISS > Controller/JSON.php
<?php
class KISS_Controller_JSON {
	private $ins;
	public function __construct($class_name){
		if (class_exists($class_name)) {
			try {
				$this->ins = new $class_name();
			} catch (Exception $error) {
				$this->showMessage($error->getMessage());
			}
		} else {
			$this->showMessage("Îļþ²»´æÔÚ£¡\\r".$_SERVER['SCRIPT_URI']);
		}
	}

	public function run() {
		echo json_encode(call_user_func_array(array(&$this->ins,$_REQUEST['method']),json_decode(stripslashes($_REQUEST['parameters']))));
	}

	public function showMessage($pMessage) {
		echo "alert('{$pMessage}');";
		die();
	}
}
?>
Return current item: KISS