how do I get url params?


Learning yii, and in codeigniter, I would create a link like:


and then get param1 using $this->uri->segment(3)

and param2 like $this->uri->segment(4)

How do I create params in yii and get their values for links?

Thanks in advance.

I figured it out.

Yii::app()->createUrl($path, $p)

Yii::app()->session['category'] = CHttpRequest::getParam('category');

Hi Frocco,

Did you mean if i want to get param in url with segment, I should did it:


In above code “id” param is following format in CUrlManager Class ;D .

In my case, it’s worked, thanks :)