views:

200

answers:

2

Can anyone tell me how to pass parameters to a function in another controller in cakephp?

+2  A: 

How are you calling that controller? If you're redirecting the user and want to pass some URL parameters (which will be passed to the controller action), just do this:

$this->redirect(array('controller' => 'foo', 'action' => 'bar', $myParam));
deceze
I'm calling the method by using $this->requestAction('/User/addToCart');It is working fine without passing any value.But now I want to send values to it. Is it possible in this case.
Joe
@Joe What about `$this->requestAction("/User/addToCart/$param");`? If that doesn't work, update your question with **more details**.
deceze
Thanks Deceze.... Its working...
Joe
A: 

http://stackoverflow.com/questions/2927209/cakephp-paginate-with-post-data-without-sessions-serialization-or-post-to-get


there is an discussion here,where params are passed using GET

openprojdevel