Home >PHP Framework >YII >yii2 routing configuration

yii2 routing configuration

王林
王林Original
2020-02-27 11:07:563021browse

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;,
   ), 
),

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!

Statement:
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