Имеются модули api по пути modules/api. В нем есть еще один модуль org: modules/api/org. В модуле org есть контроллер PersonController по пути: modules/api/org/presentation/controllers/PersonController.php - который наследуется от yii\rest\ActiveController.
Пишу конфигурацию для маршрутизации:
Код: Выделить всё
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@modules' => '@app/modules',
'@api' => '@app/modules/api',
],
'components' => [
...
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
[
'class' => UrlRule::class,
'prefix' => 'api/org',
'controller' => [
'person'
],
'patterns' => [
'PUT,PATCH {id}' => 'update',
'DELETE {id}' => 'delete',
'GET,HEAD {id}' => 'view',
'POST' => 'create',
'GET,HEAD' => 'index',
'{id}' => 'options',
'' => 'options',
]
],
'<action>'=>'site/<action>',
'<controller:[\w\-]+>/<id:\d+>' => '<controller>/view',
'<controller:[\w\-]+>/<action:[\w\-]+>/<id:\d+>' => '<controller>/<action>',
'<controller:[\w\-]+>/<action:[\w\-]+' => '<controller>/<action>',
],
],
],
],
'modules' => [
'api' => [
'class' => ApiModule::class,
'basePath' => '@api',
'modules' => [
'org' => [
'basePath' => '@api/org',
'class' => ApiOrgModule::class
]
]
],
],
Подскажите, как решить проблему?