I would like to customize input name to show in my view when happen an error in validation of the form
$this->add(array(
'name' => 'generica_descricao', // I WOULD LIKE TO CALL HIM DESCRIÇÃO
//'custom_name' => 'Descrição',
'required' => true,
'validators' => array(
array(
'name' => 'NotEmpty',
'options' => array(
'messages' => array(
'isEmpty' => 'O campo não pode ser vazio'
),
),
),
));
and when i call getMessage() as the code above
if (!$form->isValid()) {
$resultado = new Resultado(Resultado::FLAG_WARNING, $form->getMessages());
$resultado->setaRetornoLayoutErro($this->getServiceLocator());
return $resultado->getJson();
}
they will return
array('Descrição' => 'O campo não pode ser vazio');
then i will can give this array to my view and show dialog with the correctly messages, can anybody help how do that in zend?