GithubHelp home page GithubHelp logo

fastadmin_apidoc's Introduction

安装

composer require thinkers/fastadmin_apidoc

介绍

基于fastadmin api文档生成代码基础上修改,保留了全部的原生命令 新增以下功能

  • 指定任意目录生成文档
  • 排除指定的类的不生成文档

命令行

php think apidoc

配置

配置文件位于 extra/apidoc.php

[
    "includeDir" => [//需要生成文档的目录 填写项目根目录的相对路径
        '/addons/test/controller/',
        '/application/admin/controller/',
    ],
    
    "excludeClass" => [//支持排除指定的类
        'addons\test\controller\Index',
        addons\test\controller\Index::class,
    ]

如何支持fastadmin后台插件一键生成文档

修改/application/admin/controller/Command.php文件 找到doexecute()方法 添加一下代码

$commandName = "\\app\\admin\\command\\" . ucfirst($commandtype);
//在上面👆这一行后添加下面👇的代码 即可将命令替换为apidoc 一键生成文档就支持自定义目录 和 排除指定类啦 
if ($commandtype === "api") {
    $commandName = "\\thinkers\\apidoc\\commands\\". ucfirst($commandtype);
}

fastadmin_apidoc's People

Contributors

hellolxc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.