如何在Yii中获取当前操作ID?

I need a function to get the current action Id, for example if the url is /controller/view/5 I want to get the 5 which is the action Id, how I can do that in Yii?

Current action id can be taken like this,

  $id = Yii::app()->request->getParam('id');// param name

Your url is not consistent with the way Yii expects you to form a URL. The general form of a url is

http://www.application.com/your_controller/your_controller_action/parameter1_tag/parameter1_value/parameter2_tag/parameter2_value/.../parametern_tag/parametern_value

In your case:

 /controller/view/some_parameter_tag/5

if you want to hide the parameter_tag, you can customise your route, You can use '/'=>'/view',

Look here for some examples: Hide GET parameter from URL