PHP code example of iamok / yii2-swagger-ui

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

    

iamok / yii2-swagger-ui example snippets


'modules' => [
    'v1' => [
        'class' => 'app\modules\v1\Module',
    ],
    'v2' => [
        'class' => 'app\modules\v2\Module',
    ],
    'docs' => [
        'class' => 'iamok\swagger\Module',
        'name' => 'App',    // 项目名称
        'api' => [
            'v1' => ['swagger', 'controllers', 'models'],   // v1 版本,扫描目录
            'v2' => ['swagger', 'controllers', 'models']    // v2 版本,扫描目录
        ]
    ],
],