Skip to content

Instantly share code, notes, and snippets.

@andervilo02
Created March 2, 2016 19:52
Show Gist options
  • Save andervilo02/5c784296af7b68c7b739 to your computer and use it in GitHub Desktop.
Save andervilo02/5c784296af7b68c7b739 to your computer and use it in GitHub Desktop.
<?php
class Application_Form_Teste extends Zend_Form
{
public function init()
{
$this->setName('fornecedor');
$this->setAttrib('class', 'form-horizontal');
$this->addElementPrefixPath(
'Validate', APPLICATION_PATH . '/forms/validate/', 'validate'
);
}
$cnpj = new Zend_Form_Element_Text('cnpj');
$cnpj->setLabel('CNPJ')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator($notEmpty, true)
->addValidator('Cnpj')
->setAttrib('class', 'form-control cnpj')
->setAttrib('placeholder', 'CNPJ');
$uf = new Zend_Form_Element_Text('uf');
$uf->setLabel('Estado')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator($notEmpty, true)
->addValidator('Estado')
->setAttrib('class', 'form-control text-uppercase')
->setAttrib('v-model', 'fornecedor.uf')
// ->setAttrib('v-on:keyup', 'buscaSigla')
->setAttrib('placeholder', 'ESTADO')
->setAttrib('maxLength', 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment