国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

在PHP中使用ASP.NET AJAX

2024-05-04 23:05:29
字體:
來源:轉載
供稿:網友

在php中使用asp.net ajax

編寫service文件

新建一個php文件,命名為employeeservice.php。首先寫上這一句,include必要的支持代碼:

require_once 'msajaxservice.php';


然后定義一個employee類。四個屬性一目了然,不用多說:

class employee
{
public $id;
public $name;
public $email;
public $salary;

function __construct($id, $name, $email, $salary)
{
$this->id = $id;
$this->name = $name;
$this->email = $email;
$this->salary= $salary;
}
}


接下來是employeeservice類,繼承與msajaxservice.php中的msajaxservice基類。其中定義一個方法,用來返回一個employee對象:

class employeeservice extends msajaxservice
{
function getemployee()
{
return new employee(12345, "dflying chen", "[email protected]", 1000);
}
}


然后新建一個employeeservice的實例,并且調用基類的processrequest()方法,處理該請求:

$theservice = new employeeservice();
$theservice->processrequest();

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永登县| 沁源县| 德令哈市| 都匀市| 房产| 巴塘县| 惠州市| 杂多县| 海南省| 星座| 大庆市| 新野县| 庆云县| 恩平市| 汶川县| 英德市| 濮阳市| 信丰县| 曲周县| 抚顺市| 福泉市| 栾城县| 射阳县| 井研县| 饶阳县| 金寨县| 玉林市| 临潭县| 黔南| 迭部县| 中西区| 台东市| 交口县| 容城县| 湄潭县| 繁昌县| 梁平县| 南昌市| 南昌市| 额尔古纳市| 股票|