我想隐藏控制器和操作名称来自url,只有slug会显示.Eg http://localhost/test-project/frontend/web/test-condition和" test-condition"是slug。我想从我的config / main.php
中的urlManager来管理它答案 0 :(得分:1)
'urlManager' => [
'class' => 'yii\web\UrlManager',
// Disable index.php
'showScriptName' => false,
// Disable r= routes
'enablePrettyUrl' => true,
'rules' => array(
....
'<slug:[a-zA-Z0-9_ -]+>-consult' => 'CONTROLLER NAME/ACTION',
),
],