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
2010-06-01 09:42:13
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
2010-06-01 09:46:53
@Joe What about `$this->requestAction("/User/addToCart/$param");`? If that doesn't work, update your question with **more details**.
deceze
2010-06-01 10:33:28
Thanks Deceze.... Its working...
Joe
2010-06-01 10:43:11