Yii Framework Forum: Default Controller - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Default Controller Rate Topic: -----

#1 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 14 May 2010 - 03:48 AM

Hi!

I'm creating the module Admin that has some controllers - photo, movie, content, news etc. In addition, it has the AdminController that has two actions - login and logout. In this case URLs like /admin/login and /admin/logout will be handled by LoginController and LogoutController those surely does not exist :)

So how can I redirect these request to right controller?

URLs such /admin/admin/login and /admin/admin/logout looks not good :))

Thanks a lot O0
0

#2 User is offline   resplendent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 60
  • Joined: 22-May 09
  • Location:Singapore

Posted 14 May 2010 - 04:33 AM

Hi,

It's pretty simple. In your config/main.php,

'urlManager' => array(
  'rules' => array(
    'logout' => 'admin/logout',
  ),
),

2

#3 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 14 May 2010 - 05:15 AM

resplendent, thank you! :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users