This code:
$p_birthdate = new Text('p_birth_date[]');
$p_birthdate->addValidators(array(
new PresenceOf(array(
'message' => 'Birth date is not valid.'
))
));
$this->add($p_birthdate);
Renders HTML as it should be:
<input type="text" name="p_birth_date[]" value="1964-10-16" class="form-control birthDate" data-date-format="yyyy-mm-dd">
But validation is a problem. Form is never valid.
if ($f->isValid($this->request->getPost()) == false) {
foreach ($f->getMessages() as $message) {
$messages[$message->getField()] = $message->getMessage();
}
$this->view->errors = $messages;
}
All fileds with name that is array are marked as invalid.
How to do debug of this isValid method?
Maybe i am doing this wrong way.
I would appreciate some answers.