luckynvic/yii2-rest-doc

Yii2 REST Documentation Generator

Installs: 16 917

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

0.0.3-beta 2016-08-17 23:16 UTC

This package is not auto-updated.

Last update: 2024-04-13 17:13:35 UTC


README

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', 
        ],
    ],