Home > Article > PHP Framework > yii2 routing configuration
The routing configuration is as follows:
(Recommended tutorial: yii framework)
'urlManager'=>array( //'showScriptName' => true,//将url中的index.php隐藏掉 //'urlSuffix' => '.html',//开启伪静态 'urlFormat'=>'path',//path:参数以‘/‘提交;get:参数以 ’&‘提交 'caseSensitive' => true,//路由是否区分大小写 'rules'=>array( '<controller:\w+>/<id:\d+>'=>'<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), ),
For more programming related content, please pay attention PHP Chinese websiteIntroduction to Programming column!
The above is the detailed content of yii2 routing configuration. For more information, please follow other related articles on the PHP Chinese website!