Created
February 12, 2014 04:14
-
-
Save nomaanp/8949971 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$inputFilter->add($factory->createInput(array( | |
'name' => 'username', | |
'required' => true, | |
'filters' => array( | |
array('name' => 'StripTags'), | |
array('name' => 'StringTrim'), | |
), | |
'validators' => array( | |
array( | |
'name' => 'StringLength', | |
'options' => array( | |
'encoding' => 'UTF-8', | |
'min' => 3, | |
'max' => 100, | |
), | |
), | |
array( | |
'name' => 'Db\NoRecordExists', | |
'options' => array( | |
'field' => 'name', | |
'table' => 'table', | |
'adapter' => $this->dbAdapter, | |
'message' => 'record exists', | |
'exclude' => array( | |
'field' => 'id', | |
'value' => $id | |
) | |
), | |
) | |
), | |
))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment