Sastrija
Sastrija

Reputation: 3384

How to pass parameters from one controller to another in CakePHP?

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

Upvotes: 3

Views: 4408

Answers (1)

deceze
deceze

Reputation: 522606

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));

Upvotes: 4

Related Questions