php - Yii2 class Yii/web/UrlManager causes error -


i have urlmanager in web.php

        'urlmanager' =>      [         //'class' => 'yii/web/urlmanager',         'enableprettyurl' => true,         'showscriptname' => false,         'enablestrictparsing' => false,         'rules' =>          [             '<controller:\w+>/<id:\d+>' => '<controller>/view',             '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',             '<controller:\w+>/<action:\w+>' => '<controller>/<action>',         ],     ], 

i wanna know, why if uncomment 'class' => 'yii/web/urlmanager', cause error when run website.

thank much

your class path

url manager

is not correct. yii work namespace , use namespace use backslash \ instead of front slash /. code should in following format:

 'class' => 'yii\web\urlmanager', 

instead of

'class' => 'yii/web/urlmanager', 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -