Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5015 from thestanislav/PreferFormInputFilter

Allow set Form::setPreferFormInputFilter via options
  • Loading branch information...
commit 6174beb1cce0abd43b1bc5581789f05974b278f3 2 parents 1cb24f5 + cec31dd
@weierophinney weierophinney authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 library/Zend/Form/Form.php
View
20 library/Zend/Form/Form.php
@@ -122,6 +122,26 @@ class Form extends Fieldset implements FormInterface
*/
protected $validationGroup;
+
+ /**
+ * Set options for a form. Accepted options are:
+ * - prefer_form_input_filter: is form input filter is preferred?
+ *
+ * @param array|Traversable $options
+ * @return Element|ElementInterface
+ * @throws Exception\InvalidArgumentException
+ */
+ public function setOptions($options)
+ {
+ parent::setOptions($options);
+
+ if (isset($options['prefer_form_input_filter'])) {
+ $this->setPreferFormInputFilter($options['prefer_form_input_filter']);
+ }
+
+ return $this;
+ }
+
/**
* Add an element or fieldset
*
Please sign in to comment.
Something went wrong with that request. Please try again.