Use below code in your Model class:
public function getInputFilter() { if (!$this->inputFilter) { $inputFilter = new InputFilter(); $factory = new InputFactory(); $inputFilter->add($factory->createInput(array( 'name' => 'email', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'EmailAddress', 'options' => array( 'messages' => array(\Zend\Validator\EmailAddress::INVALID_FORMAT => 'Email address format is invalid', ) ), ), ), ))); $this->inputFilter = $inputFilter; } return $this->inputFilter; }
No comments:
Post a Comment