PHP code example of junguo / yii2-apidoc

1. Go to this page and download the library: Download junguo/yii2-apidoc 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/ */

    

junguo / yii2-apidoc example snippets

 php
'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
    ],
],
 php
    "yiisoft/yii2-redis": "^2.0.9"
 php
$config['modules']['apidoc'] = [
    'class'=>'junguo\apidoc\Module',
    'password'=>'123456',
    'ipFilters'=>['*','::1'],
    'domain'=>'api.xxx.com',//测试api域名,一般文档和api不在同一域名下.api index.php头部添加header('access-Control-Allow-Origin:*'); ,否则会出现跨域问题
    'tokenname'=>'access-token', // 令牌键值
     'apppath' => 'api',      //api模块路径
    'token_type' => '1',      //令牌以明文方式上传,其他参数见文档,默认1
    'ctrs' =>['controllers'], //  apppath下其他Controller 路径
];