Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Fcm\Form;
- use Zend\InputFilter\InputFilter;
- /**
- * BlockFormInputFilter
- * @package DluTwBootstrapDemo
- * @copyright David Lukas (c) - http://www.zfdaily.com
- * @license http://www.zfdaily.com/code/license New BSD License
- * @link http://www.zfdaily.com
- * @link https://bitbucket.org/dlu/dlutwbootstrap-demo
- */
- class ClientAddInputFilter extends InputFilter
- {
- public function __construct()
- {
- //Fieldset 1 Input filter
- $fs1InputFilter = new InputFilter();
- // Name
- $fs1InputFilter->add(array(
- 'name' => 'id',
- 'required' => false,
- ));
- $fs1InputFilter->add(array(
- 'name' => 'name',
- 'required' => true,
- 'validators' => array(
- array(
- 'name' => 'string_length',
- ),
- ),
- ));
- // Website
- $fs1InputFilter->add(array(
- 'name' => 'website',
- 'required' => false,
- 'validators' => array(new \Zend\Validator\Hostname(\Zend\Validator\Hostname::ALLOW_ALL)),
- ));
- // Contact
- $fs1InputFilter->add(array(
- 'name' => 'contact',
- 'required' => true,
- 'validators' => array(
- array(
- 'name' => 'string_length',
- ),
- ),
- ));
- // Email
- // new \Zend\Validator\EmailAddress()
- $fs1InputFilter->add(array(
- 'name' => 'email',
- 'validators' => array(),
- 'filters' => array(
- array('name' => 'Zend\Filter\StringTrim'),
- ),
- 'required' => true,
- ));
- // Phone
- $fs1InputFilter->add(array(
- 'name' => 'phone',
- 'required' => false,
- 'validators' => array(
- array(
- 'name' => 'string_length',
- ),
- ),
- ));
- // Comment
- $fs1InputFilter->add(array(
- 'name' => 'comment',
- 'required' => false,
- 'validators' => array(
- array(
- 'name' => 'string_length',
- ),
- ),
- ));
- $this->add($fs1InputFilter, 'fsOne');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement