I want to add common url rules from a different files in YII2. How I array merge in return Urlmanager array. I study about this
getUrlManager()->addRules
but don't know I use it.
'urlManager' => [
'class' => 'yii\web\urlManager',
'baseUrl' => $paths['baseUrl'].'/backend',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
],