【发布时间】:2015-03-08 03:07:10
【问题描述】:
我试图在 yii2 中启用漂亮的 url,但它不能按需要工作。
urlManager 配置:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'baseUrl' => '/',
]
public function actionIndex($custom_param)
{
print($custom_param);
}
example.com/mycontroller?custom_param=value 完美运行。但我需要像example.com/mycontroller/value 这样的网址。
【问题讨论】: