Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created May 23, 2011 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eminetto/987369 to your computer and use it in GitHub Desktop.
Save eminetto/987369 to your computer and use it in GitHub Desktop.
PessoaForm
<?php
abstract class PessoaForm extends Zend_Form {
    public function __construct($options = null) {
        parent::__construct($options);
        $this->generate();
    }
    private function generate() {
        $this->setName('Login');
        $username = new Zend_Form_Element_Text('username');
        $username->setLabel('Login')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty');
        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Senha')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty');
        $this->addElements(array($username, $password));
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment