I can not get the "Contact" data displayed in the Edit form. In the Edit view, it shows me the Volunteers and People data, but not the contacts data. To bring the data, I must change "echo $ this-> Form-> input ('direccion');" by echo $ this-> Form-> input ('persona.contacto.direccion'); but by doing this the contact form is not saved. What is the solution?
In my form
echo $this->Form->input('direccion'); echo $this->Form->input('persona.nombre'); echo $this->Form->input('persona.voluntario.cv');
In my function edit controller
$particulare = $this->Particulares->get($id, [
'contain' => ['Voluntarios','Beneficiarios','Personas'=>['Contactos'=>['Paises','Provincias','Localidades']]]
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$particulare = $this->Particulares->patchEntity($particulare, $this->request->getData());
if ($this->Particulares->save($particulare)) {
$this->Flash->success(__('Éxito! Los cambios han sido guardados correctamente'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('Los cambios no pudieron ser guardados. Por favor, inténtelo de nuevo.'));
}