Question: I am new to YII and i want to get the controller name i hit to add active class in menu item .my URL is like this www.myblog.com/news . I want to get the parameter "news" .Without params are possible in yii like codeigniter $product\_id = $this->uri->segment(4);

my menu structure is like this 

```
<ul class="nav navbar-nav">
                    <li class="active"><a href="news">News / Article</a></li>
                    <li><a href="players">Players</a></li>
                    <li><a href="forum">Forum</a></li>
                    <li class="dropdown">
                        <a href="rules" class="dropdown-toggle" data-toggle="dropdown">Rules <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Action</a></li>
                            <li><a href="#">Another action</a></li>
                        </ul>
                    </li>
                    <li><a href="profile">Profile</a></li>
                    <li><a href="gallery">Gallery</a></li>

                </ul>

```

Answer: 
Controller Name -

```
Yii::app()->controller->id;

```

Action Name -

```
Yii::app()->controller->action->id;

```
```
Yii::$app->controller->id;

```

and 

```
Yii::$app->controller->action->id;

```