Answer the question
In order to leave comments, you need to log in
How to fix yii2 error - UrlRule::pattern must be set.?
I tried to upload the project to the server, then I got the error
Invalid Configuration - yii\base\InvalidConfigException
UrlRule::pattern must be set.
locally everything works correctly, swears at the rules
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => true,
'rules' => [
[
'class' => 'frontend\components\UrlRouterFront'
],
'<controller>/<action>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>/*' => '<controller>/<action>',
'/' => 'site/index',
],
],
public function init()
{
$this->pattern = 'test';
$this->route = 'test';
parent::init();
}
Answer the question
In order to leave comments, you need to log in
locally everything works correctly,
[
'class' => 'frontend\components\UrlRouterFront'
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question