1 Star 0 Fork 14

崔俊/restAPI

forked from anziguoer/restAPI 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
testServer.php 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
anziguoer 提交于 2015-05-10 15:05 +08:00 . 添加验证
<?php
/**
* @Author: anziguoer@sina.com
* @Email: anziguoer@sina.com
* @link: https://git.oschina.net/anziguoer
* @Date: 2015-04-30 16:52:53
* @Last Modified by: yangyulong
* @Last Modified time: 2015-04-30 17:26:37
*/
include './ApiServer.php';
class testServer extends apiServer
{
/**
* 先执行apiServer中的方法,初始化数据
* @param object $obj 可以传入的全局对象[数据库对象,框架全局对象等]
*/
private $obj;
function __construct()//object $obj
{
parent::__construct();
//$this->obj = $obj;
//$this->resourse; 父类中已经实现,此类中可以直接使用
//$tihs->resourseId; 父类中已经实现,此类中可以直接使用
}
/**
* 获取资源操作
* @return [type] [description]
*/
protected function _get(){
echo "get";
//逻辑代码根据自己实际项目需要实现
}
/**
* 新增资源操作
* @return [type] [description]
*/
protected function _post(){
echo "post";
//逻辑代码根据自己实际项目需要实现
}
/**
* 删除资源操作
* @return [type] [description]
*/
protected function _delete(){
//逻辑代码根据自己实际项目需要实现
}
/**
* 更新资源操作
* @return [type] [description]
*/
protected function _put(){
echo "put";
//逻辑代码根据自己实际项目需要实现
}
}
$server = new testServer();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cuijun/restAPI.git
git@gitee.com:cuijun/restAPI.git
cuijun
restAPI
restAPI
master

搜索帮助