Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I retrieve a parameter value in a url
 
andrea.amaral@tratta.com.br
Jr. Member
 
Total Posts:  2
Joined:  2009-12-16
 

Hi everyone,

I need a help.
I created a custom module and sending parameter in the url.
I used the method:

$params = array( 'id' => $id);
$this->_getUrl('myModule'$params);

Now, I need retrieve the parameters value.

I used the method:

$this->getRequest()->getUserParam('id');

but did not work.
Please, semeone can help me.
regards,
Andrea Amaral

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Hi Andreea.
You can try this:

$this->getRequest()->getParam('id');
You can even pass a second parameter for the getParam method.
This will be the default value. So in case ‘id’ is not set, this call
$this->getRequest()->getParam('id'5);
will return 5.
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top