Is there any solution to add routes from module configuration?
Example. We have main config where we describe
\'components\' => [
\'urlManage
And this will be more clean and reliable. I have found this on Yii2's github repo here.
getUrlManager()->addRules([
[
'class' => 'yii\web\UrlRule',
'pattern' => $this->id,
'route' => $this->id . '/tools/index'
],
[
'class' => 'yii\web\UrlRule',
'pattern' => $this->id . '//',
'route' => $this->id . '//'
],
], false);
}
}
and just configure your main.php config file's bootstrap section as
'bootstrap' => [
'log',
'webmasters'
]
'modules' => [
'webmasters' => [
'class' => 'backend\modules\webmasters\Module'
]
]