Yii2在设置enablePrettyUrl时候,defaultAction的设置方法 原文地址:http://www.sucker-fly.com/archives/488 1. [代码] [PHP]代码 'urlManager' = [ 'enablePrettyUrl' = true,'showScriptName' = false,'enableStrictParsing' = true,
原文地址:http://www.sucker-fly.com/archives/488
1. [代码][PHP]代码
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => true, 'suffix' => ".html", 'rules' => [ '' => 'site/index', // 如果没有这里,则访问域名不能直接打开默认Action ] ]