villiwalla
@villiwalla
HTML-верстка

Почему не находит страницу?

Через gii сделал CRUD. В конфиге:
'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                '/' => 'site/index',
                'o-centre' => 'site/about',
                'contacts' => 'site/contacts',
                'VuvZueEd' => 'admin/index',
                'VuvZueEd/login' => 'admin/login',
                'VuvZueEd/logout' => 'admin/logout',
                'VuvZueEd/pages' => 'admin/pages/index',
                'VuvZueEd/events' => 'admin/events/index',
                'VuvZueEd/journal' => 'admin/journal/index',
                'VuvZueEd/services' => 'admin/services/index',
                'VuvZueEd/specialists' => 'admin/specialists/index',
                'VuvZueEd/services/category' => 'admin/servicescategory/index',
                'forms/<action:[\w-]+>' => 'forms/<action>',
                [
                    'pattern'=> 'specialists/<url:[\w-]+>',
                    'route' => 'specialists/show',
                    'suffix' => '.html',
                ],
                [
                    'pattern'=> 'services/<url:[\w-]+>',
                    'route' => 'services/show',
                    'suffix' => '.html',
                ],
                [
                    'pattern'=> 'events/<url:[\w-]+>',
                    'route' => 'events/show',
                    'suffix' => '.html',
                ],
                [
                    'pattern'=> 'journal/<url:[\w-]+>',
                    'route' => 'journal/show',
                    'suffix' => '.html',
                ],
                '<controller:[\w-]+>' => '<controller>/index',
            ],


Структура:
Модели:
./models:
ServicesCategory.php
ServicesCategorySearch.php


Контроллеры:
./controllers/admin:
ServicesCategoryController.php


Вьюхи:
./admin/services:
_form.php
_search.php
category/
create.php
index.php
update.php
view.php

./admin/services/category:
_form.php
_search.php
create.php
index.php
update.php
view.php


Перехожу по url /service/category а мне ошибку:
spoiler
An Error occurred while handling another error:
yii\base\InvalidRouteException: Unable to resolve the request: site/error in /Library/WebServer/Documents/psy-zolotoe-sechenie/vendor/yiisoft/yii2/base/Controller.php:127
Stack trace:
#0 /Library/WebServer/Documents/psy-zolotoe-sechenie/vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('error', Array)
#1 /Library/WebServer/Documents/psy-zolotoe-sechenie/vendor/yiisoft/yii2/web/ErrorHandler.php(97): yii\base\Module->runAction('site/error')
#2 /Library/WebServer/Documents/psy-zolotoe-sechenie/vendor/yiisoft/yii2/base/ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#3 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#4 {main}
Previous exception:
yii\base\InvalidRouteException: Unable to resolve the request "admin/ServicesCategory/index". in /Library/WebServer/Documents/psy/vendor/yiisoft/yii2/base/Module.php:532
Stack trace:
#0 /Library/WebServer/Documents/psy/vendor/yiisoft/yii2/web/Application.php(102): yii\base\Module->runAction('admin/ServicesC...', Array)
#1 /Library/WebServer/Documents/psy/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 /Library/WebServer/Documents/psy/web/index.php(12): yii\base\Application->run()
#3 {main}

Next yii\web\NotFoundHttpException: Страница не найдена. in /Library/WebServer/Documents/psy-zolotoe-sechenie/vendor/yiisoft/yii2/web/Application.php:114
Stack trace:
#0 /Library/WebServer/Documents/psy-zolotoe-sechenie/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 /Library/WebServer/Documents/psy-zolotoe-sechenie/web/index.php(12): yii\base\Application->run()
#2 {main}
  • Вопрос задан
  • 505 просмотров
Решения вопроса 1
slo_nik
@slo_nik Куратор тега Yii
Добрый вечер.
Всё с маленькими буквами.
'admin/ServicesCategory/index',
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы