/var/www/vhosts/ihelp.ro/httpdocs/src/Controller
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/Controller/ProposedCausesController.php (1192B)
Authentication->addUnauthenticatedActions(['add']);
}
/**
* Add method
*/
public function add()
{
$proposedCause = $this->ProposedCauses->newEmptyEntity();
if ($this->request->is('post')) {
$proposedCause = $this->ProposedCauses->patchEntity($proposedCause, $this->request->getData());
if ($this->ProposedCauses->save($proposedCause)) {
$this->Flash->success(__('Cauza propusă a fost salvată.'));
return $this->redirect(['prefix' => false, 'controller' => 'ProposedCauses', 'action' => 'add']);
}
$this->Flash->error(__('Cauza propusă nu a putut fi salvată. Vă rugăm să încercați din nou.'));
}
$this->set(compact('proposedCause'));
}
}