Answer the question
In order to leave comments, you need to log in
Why similar url requests are not accepted in yii1?
Good afternoon, there is such a problem,
2 similar controllers in the client part: ServicesController , PagesController
For some reason, I get into the ServicesController actions without problems, but I don’t get into the PagesController actions (
domen/pages/1
Error 404
Unable to process the "pages/view" request.
domain/pages/update/1
Error 404
Unable to process the request "pages/update"
In theory, the rules for them are the same and are written in config/main.php
'<action:(login|logout|registration)>' => 'users/<action>',
'<action:(contact)>' => 'site/<action>',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
/** Менеджер */
'<module:smanager>' => '<module>/services/index',
'<module:smanager>/<controller:\w+>/<id:\d+>' => '<module>/<controller>/view',
'<module:smanager>/<controller:\w+>' => '<module>/<controller>/index',
'<module:smanager>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
'<module:smanager>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
...
public function actionIndex() {
$model = Pages::model()->findByPk(1);
$this->render('index', [
'model' => $model
]);
}
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question