Merge pull request #483 from MatteoF96/master

Fixed prefix for REST APIs
This commit is contained in:
Lorenzo Milesi
2022-11-24 12:04:26 +01:00
committed by GitHub
3 changed files with 11 additions and 2 deletions

View File

@ -333,7 +333,11 @@ Default value = `yii\filters\auth\QueryParamAuth` class, therefore access tokens
#### adminRestPrefix (type: `string`, default: `user/api/v1`)
Route prefix for REST admin controller.
Prefix for the pattern part of every rule for REST admin controller.
#### adminRestRoutePrefix (type: `string`, default: `user/api/v1`)
Prefix for the route part of every rule for REST admin controller.
#### adminRestRoutes (type `array`)

View File

@ -291,6 +291,7 @@ class Bootstrap implements BootstrapInterface
$config = [
'class' => 'yii\web\GroupUrlRule',
'prefix' => $module->adminRestPrefix,
'routePrefix' => $module->adminRestRoutePrefix,
'rules' => $rules,
];
$rule = Yii::createObject($config);

View File

@ -260,9 +260,13 @@ class Module extends BaseModule
*/
public $authenticatorClass = 'yii\filters\auth\QueryParamAuth';
/**
* @var string Route prefix for REST admin controller.
* @var string Prefix for the pattern part of every rule for REST admin controller.
*/
public $adminRestPrefix = 'user/api/v1';
/**
* @var string Prefix for the route part of every rule for REST admin controller.
*/
public $adminRestRoutePrefix = 'user/api/v1';
/**
* @var array Routes for REST admin controller.
*/