moho
(Goldendegree)
May 10, 2009, 3:59am
1
I have some menu items and would like to highlight the current menu item. For example, I have menu item that links to post/list/?categoryID=5
What is the easiest way to know:
Current controller is Post
Current method is List
Current categoryID is five?
qiang
(Qiang Xue)
May 10, 2009, 4:04am
2
Yii::app()->controller->id and Yii::app()->controller->action->id give you the first two pieces of information. You will need to solve the last problem by your own.
will
(Phpwindcn)
May 10, 2009, 6:39pm
4
A note for those interested.
If your controller is under a module, e.g. admin/index
Yii::app()->controller->id only returns 'index', if you want to get the full controller name, you should use
Yii::app()->controller->UniqueId, which returns 'admin/index'