@@ -519,7 +519,7 @@ class SenderFieldset extends Fieldset implements InputFilterProviderInterface
519
519
),
520
520
'validators' => array(
521
521
array(
522
- 'name' => 'Zend\Validator\StringLength',
522
+ 'name' => 'Zend\Validator\StringLength',
523
523
'options' => array(
524
524
'min' => 3,
525
525
'max' => 256
@@ -561,15 +561,15 @@ that in action.
561
561
When you ` bind() ` an object to the form, the following happens:
562
562
563
563
- The composed ` Hydrator ` calls ` extract() ` on the object, and uses the values returned, if any, to
564
- populate the ` value ` attributes of all elements. If a form contains a fieldset that itself contains
565
- another fieldset, the form will recursively extract the values.
564
+ populate the ` value ` attributes of all elements. If a form contains a fieldset that itself contains
565
+ another fieldset, the form will recursively extract the values.
566
566
- When ` isValid() ` is called, if ` setData() ` has not been previously set, the form uses the composed
567
- ` Hydrator ` to extract values from the object, and uses those during validation.
567
+ ` Hydrator ` to extract values from the object, and uses those during validation.
568
568
- If ` isValid() ` is successful (and the ` bindOnValidate ` flag is enabled, which is true by default),
569
- then the ` Hydrator ` will be passed the validated values to use to hydrate the bound object. (If you
570
- do not want this behavior, call ` setBindOnValidate(FormInterface::BIND_MANUAL) ` ).
569
+ then the ` Hydrator ` will be passed the validated values to use to hydrate the bound object. (If you
570
+ do not want this behavior, call ` setBindOnValidate(FormInterface::BIND_MANUAL) ` ).
571
571
- If the object implements ` Zend\InputFilter\InputFilterAwareInterface ` , the input filter it
572
- composes will be used instead of the one composed on the form.
572
+ composes will be used instead of the one composed on the form.
573
573
574
574
This is easier to understand in practice.
575
575
@@ -858,46 +858,46 @@ annotations in `Zend\Form`:
858
858
859
859
- * AllowEmpty* : mark an input as allowing an empty value. This annotation does not require a value.
860
860
- * Attributes* : specify the form, fieldset, or element attributes. This annotation requires an
861
- associative array of values, in a JSON object format:
862
- ` @Attributes({"class":"zend_form","type":"text"}) ` .
861
+ associative array of values, in a JSON object format:
862
+ ` @Attributes({"class":"zend_form","type":"text"}) ` .
863
863
- * ComposedObject* : specify another object with annotations to parse. Typically, this is used if a
864
- property references another object, which will then be added to your form as an additional fieldset.
865
- Expects a string value indicating the class for the object being composed
866
- ` @ComposedObject("Namespace\Model\ComposedObject") ` or an array to compose a collection:
867
- `@ComposedObject({ "target_object":"Namespace\Model\ComposedCollection", "is_collection":"true",
868
- "options":{"count":2}})` ` target_object` is the element to compose, ` is_collection` flags this as a
869
- collection and ` options ` can take an array of options to pass into the collection.
864
+ property references another object, which will then be added to your form as an additional fieldset.
865
+ Expects a string value indicating the class for the object being composed
866
+ ` @ComposedObject("Namespace\Model\ComposedObject") ` or an array to compose a collection:
867
+ `@ComposedObject({ "target_object":"Namespace\Model\ComposedCollection", "is_collection":"true",
868
+ "options":{"count":2}})` ` target_object` is the element to compose, ` is_collection` flags this as a
869
+ collection and ` options ` can take an array of options to pass into the collection.
870
870
- * ErrorMessage* : specify the error message to return for an element in the case of a failed
871
- validation. Expects a string value.
871
+ validation. Expects a string value.
872
872
- * Exclude* : mark a property to exclude from the form or fieldset. This annotation does not require
873
- a value.
873
+ a value.
874
874
- * Filter* : provide a specification for a filter to use on a given element. Expects an associative
875
- array of values, with a "name" key pointing to a string filter name, and an "options" key pointing
876
- to an associative array of filter options for the constructor: `@Filter({"name": "Boolean",
877
- "options": {"casting": true }})`. This annotation may be specified multiple times.
875
+ array of values, with a "name" key pointing to a string filter name, and an "options" key pointing
876
+ to an associative array of filter options for the constructor: `@Filter({"name": "Boolean",
877
+ "options": {"casting": true }})`. This annotation may be specified multiple times.
878
878
- * Flags* : flags to pass to the fieldset or form composing an element or fieldset; these are usually
879
- used to specify the name or priority. The annotation expects an associative array:
880
- ` @Flags({"priority": 100}) ` .
879
+ used to specify the name or priority. The annotation expects an associative array:
880
+ ` @Flags({"priority": 100}) ` .
881
881
- * Hydrator* : specify the hydrator class to use for this given form or fieldset. A string value is
882
- expected.
882
+ expected.
883
883
- * InputFilter* : specify the input filter class to use for this given form or fieldset. A string
884
- value is expected.
884
+ value is expected.
885
885
- * Input* : specify the input class to use for this given element. A string value is expected.
886
886
- * Instance* : specify an object class instance to bind to the form or fieldset.
887
887
- * Name* : specify the name of the current element, fieldset, or form. A string value is expected.
888
888
- * Object* : specify an object class instance to bind to the form or fieldset. (Note: this is
889
- deprecated in 2.4.0; use * Instance* instead.)
889
+ deprecated in 2.4.0; use * Instance* instead.)
890
890
- * Options* : options to pass to the fieldset or form that are used to inform behavior -- things that
891
- are not attributes; e.g. labels, CAPTCHA adapters, etc. The annotation expects an associative array:
892
- ` @Options({"label": "Username:"}) ` .
891
+ are not attributes; e.g. labels, CAPTCHA adapters, etc. The annotation expects an associative array:
892
+ ` @Options({"label": "Username:"}) ` .
893
893
- * Required* : indicate whether an element is required. A boolean value is expected. By default, all
894
- elements are required, so this annotation is mainly present to allow disabling a requirement.
894
+ elements are required, so this annotation is mainly present to allow disabling a requirement.
895
895
- * Type* : indicate the class to use for the current element, fieldset, or form. A string value is
896
- expected.
896
+ expected.
897
897
- * Validator* : provide a specification for a validator to use on a given element. Expects an
898
- associative array of values, with a "name" key pointing to a string validator name, and an "options"
899
- key pointing to an associative array of validator options for the constructor: `@Validator({"name":
900
- "StringLength", "options": {"min":3, "max": 25}})`. This annotation may be specified multiple times.
898
+ associative array of values, with a "name" key pointing to a string validator name, and an "options"
899
+ key pointing to an associative array of validator options for the constructor: `@Validator({"name":
900
+ "StringLength", "options": {"min":3, "max": 25}})`. This annotation may be specified multiple times.
901
901
902
902
To use annotations, you simply include them in your class and/or property docblocks. Annotation
903
903
names will be resolved according to the import statements in your class; as such, you can make them
0 commit comments