comprex
comprex

Reputation: 763

URL management using Yii

I have url: /profile/profileBase/index where "profile" is module, "profileBase" is controller and "index" is action. I want to url manager would accept route like: /profile/read/index where "read" could be alias of controller. Is there any way to do this using url manager rules? Thanks

Upvotes: 0

Views: 84

Answers (2)

soju
soju

Reputation: 25302

You should simply add the following rule in urlManager config :

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

Upvotes: 0

Dinesh Saini
Dinesh Saini

Reputation: 2916

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

Upvotes: 1

Related Questions