PHP code example of psr4 / reflection-api-doc
1. Go to this page and download the library: Download psr4/reflection-api-doc library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
psr4 / reflection-api-doc example snippets
/**
* @title 文章接口管理
*/
class Article extends Controller
{
/**
* @title 获取文章列表
* @desc 1.接口地址:http://open.opqnext.com/index.php?c=article&a=index
* @desc 2.请求方式:GET
* @desc 3.接口备注:必须传入keys值用于通过加密验证
* 传参格式 1.类型(int,string....) 2.名称(例子:page)第一个为*则必填 3.默认值(任意字符串不带空格) 4.描述(任意字符串)
* @param int *page 1 页数
* @param string *keys xxx 加密字符串,substr(md5(\"约定秘钥\".$page),8,16)
* @param string word null 搜索关键字
* @param int cate 0 分类ID,不传表示所有分类
* @param int size 5 每页显示条数,默认为5
* 返回值格式 1.类型(int,string....) 2.名称(例子:page)第一个为*则必填 开头-号的数量代表层级 3.描述(任意字符串
* @return int *-status 返回码:1成功,0失败
* @return string *-message 返回信息
* @return array *-data 返回数据
* @return string *--id 文章ID(22位字符串)
* @return string *--title 文章标题
* @return string *--thumb 文章列表图
* @return text *--content 文章内容
* @return int *--cate 文章分类
* @return array *--tags 文章标签
* @return string *---id 标签ID
* @return string *---tag 标签名称
* @return int *---count 标签使用数
* @return array *--img 文章组图
* @route('index', 'get')
*/
public function index(){
//... 具体实现方法
}