Supposing that your array $contact
be something like that:
array(
'nome' => 'Fulano',
'email' => '[email protected]'
);
You would have two ways to receive these values in your action. The first is passing each of these pairs of value key as a parameter in array of the method 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 receive so:
// URL: controller/duplicate/nome:Fulano/email:[email protected]
public function duplicate($nome, $email) {
}
Or how query string, you can spend the whole array:
$this->redirect(array(
'action' => 'duplicate',
'?' => $contact)
);
That’s how you’ll stay:
// URL: controller/duplicate?nome=Fulano&[email protected]
public function duplicate() {
echo $this->request->params['nome'];
echo $this->request->params['email'];
}
Thank you very much for the reply, I did the first way and gave it right here.
– Devidy Oliviera