/yii2-rest-doc

Yii2 Restfull Api Document Generator

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

yii2-rest-doc

Yii2 rest api document generator. This extension use yii console to build rest api documentation using php-apidoc.

Installation

Installation is recommended to be done via composer by running:

composer require luckynvic/yii2-rest-doc "*"

Alternatively you can add the following to the require section in your composer.json manually:

"luckynvic/yii2-rest-doc": "*"

Run composer update afterwards.

Setup

Add to your console config

    'controllerMap' => [
        'build-rest-doc' => [
            'class' => '\luckynvic\restdoc\BuilderController',
            'sourceDirs' => [
                '@api/controllers', // api controller path
            ],
            'outputDir' => 'docs/rest',
            'outputFile' => 'index.html',
            //optional
            'templatePath' => dirname(__DIR__).'/../docs/rest/template/index.html', 
        ],
    ],