示例#1
0
文件: S2ajax.php 项目: ksecor/s2ajax
 function s2ajax_export_method($clName, $fnName)
 {
     s2ajax_export($clName . '$' . $fnName);
 }
示例#2
0
<?
require("S2ajax.php");
$s2ajax_request_type = "GET";
// Note that exported methods are static!
s2ajax_export('TypeTester$return_array', 'TypeTester$return_object');
s2ajax_method_export(TypeTester, return_string);
s2ajax_export(array(TypeTester, return_int), array(TypeTester, return_float));
// And now, let's handle the user's request
s2ajax_handle_client_request();

class MyObj
{
var $name, $age;

	function MyObj($name, $age)
	{
		$this->name = $name;
		$this->age = $age;
	}
}

class TypeTester
{
	static function return_array() {
		return array("name" => "Tom", "age" => 26);
	}
	
	static function return_object() {
		$o = new MyObj("Tom", 26);
		return $o;
	}