Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow set Form::setPreferFormInputFilter via options #5015

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+20 −0
Split
View
@@ -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
*