Assuming your array $contact
looks something like this:
array(
'nome' => 'Fulano',
'email' => '[email protected]'
);
You would have two ways to receive these values in your action . The first one is passing each of these key-value pairs as its own parameter in the array method of redirect
:
$this->redirect(array(
'action' => 'duplicate',
'nome' => 'Fulano',
'email' => '[email protected]')
);
All values subsequent to action will be a parameter of your method, which you will get as follows:
// URL: controller/duplicate/nome:Fulano/email:[email protected]
public function duplicate($nome, $email) {
}
As query string , you can pass the whole array :
$this->redirect(array(
'action' => 'duplicate',
'?' => $contact)
);
It will look like this:
// URL: controller/duplicate?nome=Fulano&[email protected]
public function duplicate() {
echo $this->request->params['nome'];
echo $this->request->params['email'];
}