Answer the question
In order to leave comments, you need to log in
Why doesn't routing work in yii2 module?
Good afternoon!
In the advanced application, a module has been created via gii with the following structure:
frontend
|__ ...
|__modules
|__ orderDescription
|__ controllers
|__ DefaultController
|__ models
|__ search
|__ GroupSearch
|__ ManufacturerSearch
|__ OrderItemSearch
|__ OrderSearch
|__ ProductSearch
|__ Group
|__ Manufacturer
|__Order
|__OrderItem
|__Product
|__ views
|__ default
|__ _form
|__ _search
|__ about
|__ create
|__ index
|__ update
|__ view
public static function getDb() {
return Yii::$app->get('db2'); // second database
}
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'class' => 'yii\web\UrlManager',
'rules' => [
'kbase/<id>' => 'article/view',
'kbase/tag/<tag>' => 'article/index',
'kbase' => 'article/index',
'search' => 'search/index',
'finder/<action>' => 'vendor-code/<action>',
'library/read-later' => 'library/read-later',
'library/reading' => 'library/reading',
'library/bookshelf' => 'library/bookshelf',
'library/control' => 'library/control',
'library/tags' => 'library/tags',
'library/<id:\d+>' => 'library/view',
'library' => 'library/index',
'login' => 'site/login',
'logout' => 'site/logout',
'request-password-reset' => 'site/request-password-reset',
'reset-password' => 'site/reset-password',
'feedback/create' => 'feedback/create',
'/' => 'article/index',
'orderDescription' => 'orderDescription',
]
]
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