Hi,
I'm having problems to put and merge model with forms validation.
In my first attempt, I create a method on form called "mergeValidation", with message parameters, something like this code below:
// in form public function mergeValidation($messages) { foreach($messages as $message) {
$field = $this->get($message->getField());
if(/* verify if field exists and it has a "appendMessage" method -- returns true*/)
$field->appendMessage($message->getMessage());
}
}
// in controller
if($model->save()) { $form->mergeValidation($model->getMessages()); } $this->view->form = $form;
But it's not work and the Exception returns something like: "Method appendmessage in a non-object" (appendmessage all in lowercase)
If someone has another solution... Thanks