What I want to achieve is to add custom attributes to the form, which are:
'validType' => 'remote[\'/catalogos/acl/compruebarecurso\',\'nombre\']',
'invalidmessage' => 'Al parecer el nombre ya existe'.
The problem lies in the view, since it does not generate the correct HTML
class RecursosForm extends Form
{
// TODO - Insert your code here
/**
*/
public function __construct($name = null){
parent::__construct($name);
$this->add(array(
'name' => 'nombre',
'type' => 'Zend\Form\Element\Text',
'attributes' => array(
'class' => 'easyui-validatebox',
'validType' => 'remote[\'/catalogos/acl/compruebarecurso\',\'nombre\']',
'invalidmessage' => 'Al parecer el nombre ya existe'
),
'options' => array(
'label' => 'Recurso:',
'label_attributes' => array('class' => 'fitem'),
)
));
}
}