Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Chepurnoy committed Oct 14, 2017
1 parent e87f88b commit c7a2255
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,45 @@ or add
```

to the require section of your composer.json.

Configuration
-------------
You need to configure two actions as follows:

```php
<?php

namespace app\controllers;

use Yii;
use yii\helpers\Url;
use yii\web\Controller;

/**
* Class SiteController
*
* @package app\controllers
*/
class SiteController extends Controller
{
/**
* @inheritdoc
*/
public function actions(): array
{
return [
'docs' => [
'class' => 'yii2mod\swagger\SwaggerAction',
'restUrl' => Url::to(['site/json-schema']),
],
'json-schema' => [
'class' => 'yii2mod\swagger\SwaggerApiAction',
// Тhe list of directories that contains the swagger annotations.
'scanDir' => [
Yii::getAlias('@app/modules/api'),
],
],
];
}
}
```

0 comments on commit c7a2255

Please sign in to comment.