PHP code example of zhuzixian520 / yii2-api-doc

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

    

zhuzixian520 / yii2-api-doc example snippets


return [
    'modules' => [
        'api_doc' => [
            'class' => 'zhuzixian520\api_doc\Module',
            'hostApiDev' => 'http://api-dev.demo.com',//开发环境接口主机地址
            'hostApiProd' => 'http://api.demo.com',//生产环境接口主机地址
            'hostApiTest' => 'http://api-test.demo.com',//测试环境接口主机地址
            'author' => 'Trevor',
            'email' => '[email protected]',
            'logo_src' => '/img/logo_64_64.png',//web目录下
            'icp_num' => '粤ICP备15025495号',
            'copyright_website' => 'http://www.sijiche.com',
            'company_start_year' => '2015',
        ],
        'v1' => [
            'class' => 'api\modules\v1\V1Module',
        ],
    ],
];

class PassportController extends yii\rest\Controller
{
    /**
     * 微信PC网页登录
     * @method POST
     * @token 0
     * @param string code 同意授权后的code 是
     * @res string token 访问令牌
     * @return array
     */
    public function actionLoginByWechatPc(): array {}
}