Please help me figure it out.

For convenience, the controllers are located in the folder controllers / admin . On the local OpenServer, everything worked fine. And when moving to an open hosting (REG.RU) there were problems.

In the Debug panel, routines are spelled correctly, but for some reason they cannot find the file view / index.php.

if (is_file($viewFile)) { $viewFile = FileHelper::localize($viewFile); } else { throw new InvalidParamException("The view file does not exist: $viewFile"); } $oldContext = $this->context; 

Does not see the view file

This is how my UrlManager looks like:

 'urlManager' => [ 'class' => 'yii\web\UrlManager', // Disable index.php 'showScriptName' => false, // Disable r= routes 'enablePrettyUrl' => true, 'rules' => [ '<controller:\w+>/<id:\d+>' => '<controller>/view', '<controller:\w+>/<action:\w+>' => '<controller>/<action>', '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', ], ], 

In this format, built menu Nav :: Widget

 'items' => [ ['label' => 'Просмотреть все', 'url' => ['/admin/lot']], '<li class="divider"></li>', '<li class="dropdown-header">Управление</li>', ['label' => 'Добавить лот', 'url' => ['/admin/lot/create']], ['label' => 'Описания лотов', 'url' => ['/admin/lotcomment']], ['label' => 'Свойства лотов', 'url' => ['/admin/lotproperty']], ['label' => 'Работа с изображениями', 'url' => ['/admin/img_upload']], ], 

I can not understand what's wrong. help me please

  • Try adding baseUrl in config / web.php. Find the line where there is a cookieValidationKey and below right below it type 'baseUrl' => '', - Urmuz Tagizade
  • Maybe it makes sense to use a modular structure, instead of nesting folders? So you can share common and admin controllers, views and models - Ninazu
  • Thank you so much, baseUrl didn't help. Indeed, it would be more appropriate to use the module for these purposes. - Nikolay Nikiforov

0