How to get value from url

Hi All,

I’d like to know if there is an Yii function to get a value from url. The url that I have is:


http://www.domain.com/index.php/module/controller/update/id/111

I need to get the value ‘111’ before it gets to the update action, is there an Yii method to do it? I’ve tried with:




Yii::app()->request->getUrl();

Yii::app()->request->getParams('id');

$_GET['id'];



… without success.

I’d really appreciate your help.

Thanks,

Alejandro.

$id = Yii::app()->request->getQuery(‘id’); //that should do it if you are doing it all right.

That’s what I was looking for. Thanks very much!!

Actually, the problem was that I’d written the code in the wrong method. I was using init() function of my_moduleModule class, then changed that for beforeControllerAction function and it all worked, even


Yii::app()->getRequest()->getParam('id')

Cheers!

Alejandro.

[color="#006400"]/* Moved from Yii Powered to Yii 1.1 General Discussion */[/color]