anessoft / yii2-apidoc
用于自动载入接口文档及提供接口调试
This package's canonical repository appears to be gone and the package has been frozen as a result.
v0.0.1
2018-01-05 09:00 UTC
Requires
- dmstr/yii2-adminlte-asset: ~2.3
- yiisoft/yii2: ~2.0.7
This package is auto-updated.
Last update: 2020-08-06 00:44:04 UTC
README
安装
composer require anessoft/yii2-apidoc
访问
http://xx.com/apidoc
排除
排除有属性$noapidoc
的控制器
eg:
class DefaultController extends \yii\web\Controller
{
public $noapidoc;
...
}
排除命名为^test(\w+)$
的方法
eg:
...
public function actionTestimport(){
...
}
...
方法名
方法注解第一行
自定义接口测试
第二行如果命名^testApi:(.+)$
则$1
为接口测试地址
使用示例
$config['bootstrap'][] = 'apidoc';
$config['modules']['apidoc'] = [
'class' => 'anes\apidoc\Module',
];
必须在控制器基类添加下行
use \anes\apidoc\components\BaseApidoc;