سؤال

I'm looking for form validation syntax for an Email address in array notation.

This is what i have currently.

 $this->addElement('text', 'email', array(
    'placeholder' => 'email address',
    'required' => true,
    'filters' => array(
        array('name', 'StringTags'),
        arary('name', 'StringTrim'),
    ),
    'validators' => array('EmailAddress')
 ));

Any help would be greatly appreciated.

Cheers, Daniel.

هل كانت مفيدة؟

المحلول

You just need wrap it in one more array:

'validators' => array(array('EmailAddress')),
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top