zend-inputfilter

zf2 Form Collection Validation - Unique Elements in Fieldsets

╄→尐↘猪︶ㄣ 提交于 2019-12-24 13:10:40
问题 I want to add unique Elements in a Zend Form Collection. I found this awesome work from Aron Kerr I do the forms and fieldsets like in Aron Kerr´s Example and it works fine. In my case i create a Form to insert a collection of stores from a company. My Form First of all i have a Application\Form\CompanyStoreForm with a StoreFieldset like this: $this->add(array( 'name' => 'company', 'type' => 'Application\Form\Stores\CompanyStoresFieldset', )); The Fieldsets Application\Form\Stores

How to apply InputFilter validators to fieldset elements in ZF3

独自空忆成欢 提交于 2019-12-13 03:49:59
问题 I had a form that had two fields. An InputFilter with validators was applied to it. It was working fine. Then I moved the fields to a fieldset and added the fieldset to the form. Now the assignment validators to the fields is not present. The validator objects isValid method is not triggered at all. So how to apply the InputFilter validators to fields in a fieldset? Here you are the classes: Text class Validator namespace Application\Validator; use Zend\Validator\StringLength; use Zend

ZF2 : Priority for Validators in InputFilter

一世执手 提交于 2019-12-12 17:27:16
问题 I have a validator on a form entry like this : $this->add(array( 'name' => 'email', 'required' => true, 'filter' => array( 'name' => 'StripTags', ), 'validators' => array( array( 'name' => 'NotEmpty', 'options' => array( 'messages' => array( \Zend\Validator\NotEmpty::IS_EMPTY => 'Veuillez renseigner une adresse e-mail.', ), ), ), array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 100, ), ), array( 'name' => 'EmailAddress', 'options' => array( ), )

Difference between InputFilterAwareInterface and InputFilterProviderInterface in ZF2

邮差的信 提交于 2019-12-08 03:37:33
Can someone explain me the difference between both interfaces InputFilterAwareInterface and InputFilterProviderInterface? Both seem to serve to the same purpose, to get an InputFilter, but I know they cannot be the same... And when do they get called? Thanks edigu Both interfaces exist for different purposes. The InputFilterAwareInterface guarantees that implemented classes will have a setInputFilter() and getInputFilter() methods which accept and return an InputFilter instance when necessary. On the other hand, the InputFilterProviderInterface guarantees only that implemented classes will

Difference between InputFilterAwareInterface and InputFilterProviderInterface in ZF2

元气小坏坏 提交于 2019-12-08 03:12:03
问题 Can someone explain me the difference between both interfaces InputFilterAwareInterface and InputFilterProviderInterface? Both seem to serve to the same purpose, to get an InputFilter, but I know they cannot be the same... And when do they get called? Thanks 回答1: Both interfaces exist for different purposes. The InputFilterAwareInterface guarantees that implemented classes will have a setInputFilter() and getInputFilter() methods which accept and return an InputFilter instance when necessary.