Permalink
Browse files

Implement setOptions method

  • Loading branch information...
1 parent 1cb24f5 commit 5c99a164635aa6fffd44c2f380be30bfcaf41d72 @thestanislav committed Aug 24, 2013
Showing with 20 additions and 0 deletions.
  1. +20 −0 library/Zend/Form/Form.php
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 prefered?
+ *
+ * @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
*

0 comments on commit 5c99a16

Please sign in to comment.