Home > PHP Framework > YII > yii2 routing configuration

yii2 routing configuration

王林
Release: 2020-02-27 11:07:56
Original
3001 people have browsed it

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( 
    &#39;<controller:\w+>/<id:\d+>&#39;=>&#39;<controller>/view&#39;, 
    &#39;<controller:\w+>/<action:\w+>/<id:\d+>&#39;=>&#39;<controller>/<action>&#39;, 
    &#39;<controller:\w+>/<action:\w+>&#39;=>&#39;<controller>/<action>&#39;,
   ), 
),
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template