Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created May 23, 2011 19:31
Show Gist options
  • Save eminetto/987373 to your computer and use it in GitHub Desktop.
Save eminetto/987373 to your computer and use it in GitHub Desktop.
AlunoForm
<?php
class AlunoForm extends PessoaForm {
    public function __construct($options = null) {
        parent::__construct($options);
        $this->generate();
    }
   
    private function generate() {
        $matricula = new Zend_Form_Element_Text('matricula');
        $matricula->setLabel('Matrícula')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty');
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Entrar');
        $submit->setAttrib('id', 'Entrar');
        $this->addElements(array($matricula,$submit));
        //action e method
        $this->setAction(BASE_URL.'/index/index')->setMethod('post');
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment