从 url yii 中删除控制器和操作
Remove controller and action from url yii
我想对 url 隐藏控制器和动作名称,只有 slug show.E.g http://localhost/test-project/frontend/web/test-condition 和 "test-condition" slug.I 想要管理这是来自我 config/main.php
的 url 经理
'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',
),
],
我想对 url 隐藏控制器和动作名称,只有 slug show.E.g http://localhost/test-project/frontend/web/test-condition 和 "test-condition" slug.I 想要管理这是来自我 config/main.php
的 url 经理'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',
),
],