Created
October 29, 2012 17:42
-
-
Save alexshelkov/3975120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Form; | |
use Zend\Form\Form; | |
use Zend\Stdlib\Hydrator\ClassMethods as ClassMethodsHydrator; | |
use Zend\InputFilter\InputFilterProviderInterface; | |
class UserRegister extends Form implements InputFilterProviderInterface | |
{ | |
public function __construct($name = null, $options = array()) | |
{ | |
parent::__construct('user_register', $options); | |
$this->setAttribute('method', 'post'); | |
$this->setHydrator(new ClassMethodsHydrator(false)); | |
// I create and add fieldset Application\Form\Fieldset\User | |
$this->add(array( | |
'type' => 'Application\Form\Fieldset\User', | |
'options' => array( | |
'use_as_base_fieldset' => true | |
) | |
)); | |
$this->add(array( | |
'name' => 'submit', | |
'attributes' => array( | |
'type' => 'submit', | |
'value' => 'Register', | |
) | |
)); | |
} | |
public function getInputFilterSpecification() | |
{ | |
return array( | |
// here I want some filter and validator for my user.name | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment