yii2-apidoc

删除 composer.lock 文件后,执行:

composer update yiisoft/yii2-apidoc cebe/markdown

console 配置文件夹:

'controllerMap' => [
    'api' => [
        'class' => 'yii\apidoc\commands\ApiController',
    ],
    'guide' => [
        'class' => 'yii\apidoc\commands\GuideController',
    ],
],
  • api 生成类API文档
  • guid 将 markdown 文档渲染为 HTML 页面

执行:

./yii api frontend/controllers docs/frontend/controllers

其他用法,参考:https://github.com/yiisoft/yii2-apidoc