This action will force synchronization from 雨空/cmlphp2.5-demo-api, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
本项目为基于CmlPHP V2.x开发的一个api项目示例。包含了api开发的两个接口示例以及根据代码注释自动生成文档的示例。
还不知道什么是CmlPHP?点这里了解
下载本示例之前请先下载 CmlPHPV2.x 项目推荐目录骨架.然后将本项目放到projxxx下。本示例使用了valitron验证插件,所以需要在composer.json require中加入
"vlucas/valitron" : "*"
然后执行composer update
。当然了如果你没有安装composer也可以直接下载我打包好的zip包(包含了项目目录骨架) api_demo_zip
主要的配置文件在 projxxx/Application/api/Config/api.php中
查看配置,我们看到在配置中我们配置了V1版本有注册、登录两个接口。
我们来看下其中的注册接口
我们看到了注释中的接口描述、参数、请求示例、返回成功/失败示例。
请修改api.php
中相应的lookup_doc_key
。
打开文档查看地址http://xxx/index.php/api/Bootstrap/doc/key/lookup_doc_key
我们看到了自动生成的接口文档。很简单吧。动起来吧。
开发过程中的目录及程序接口请参考 CmlPHP V2.x开发手册
Sign in for post a comment
Comments ( 0 )