首页 文章

使用Yii进行URL管理

提问于
浏览
0

我有url:/ profile / profileBase / index其中“profile”是模块,“profileBase”是controller,“index”是action . 我想url manager会接受如下路由:/ profile / read / index其中“read”可能是控制器的别名 . 有没有办法使用网址管理器规则?谢谢

2 回答

  • 1
    'urlManager' => array(
            'urlFormat' => 'path',
            'showScriptName' => false,
            'rules' => array(
              'profile/read/index '=>'profile/profileBase/index'
            ),
        ),
    
  • 0

    您只需在 urlManager config中添加以下规则:

    'profile/read/index'=>'profile/profileBase/index',
    

相关问题