Created
October 29, 2012 17:45
-
-
Save alexshelkov/3975150 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\Fieldset; | |
use Zend\Form\Fieldset as ZendFieldset; | |
use Application\Model\User as ModelUser; | |
use Zend\Stdlib\Hydrator\ClassMethods as ClassMethodsHydrator; | |
use Zend\InputFilter\InputFilterProviderInterface; | |
class User extends ZendFieldset implements InputFilterProviderInterface | |
{ | |
public function __construct($name = null, $options = array()) | |
{ | |
parent::__construct('user'); | |
$this->setHydrator(new ClassMethodsHydrator()); | |
$this->setObject(new ModelUser()); | |
$this->add(array( | |
'name' => 'name', | |
'options' => array( | |
'label' => 'User name', | |
), | |
'attributes' => array( | |
'type' => 'text', | |
), | |
)); | |
} | |
// I want add some basic filters here too | |
public function getInputFilterSpecification() | |
{ | |
return array( | |
'name' => array( | |
'filters' => array( | |
array('name' => 'Zend\Filter\StringTrim'), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment