Hi,
I'd like to seperate index from create actions. But the POST data doesn't get inserted when the form isn't valid. Short version of my code:
public function indexAction() {
// Set form
$this->view->registrationForm = new RegistrationForm;
}
public function createAction() {
$registrationForm = new RegistrationForm;
// Check if post
if ($this->request->isPost()) {
if (!$registrationForm->isValid($this->request->getPost())) {
foreach ($registrationForm->getMessages() as $message) {
$this->flash->error($message->getMessage());
}
$this->response->redirect('/nutzer/registrierung/');
} else {
// save
}
}
}
The error messages appear but the POST data isn't populated.