/**
  * Accepted options for FilterForm:
  * - filters: a container with the available filters. The filters will be
  *            added as text fields to the filter fieldset.
  *
  * @param array|Traversable $options Options
  * 
  * @return FilterForm
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['filters'])) {
         $this->setFilters($options['filters']);
     }
     return $this;
 }
 public function setOptions($options)
 {
     $desc = isset($this->options['description']) ? $this->options['description'] : null;
     parent::setOptions($options);
     if (isset($options['enable_descriptions'])) {
         $this->setIsDescriptionsEnabled($options['enable_descriptions']);
     }
     if (!isset($options['description']) && null !== $desc) {
         $this->options['description'] = $desc;
     }
 }
Example #3
0
 public function setOptions($options)
 {
     parent::setOptions($options);
     $options = $this->options;
     // assure array
     if (isset($options['elements_fieldset'])) {
         $this->elementsFieldset = $options['elements_fieldset'];
     }
     if (isset($options['buttons_fieldset'])) {
         $this->buttonsFieldset = $options['buttons_fieldset'];
     }
     if (isset($options['name'])) {
         $this->setName($options['name']);
     }
     return $this;
 }
Example #4
0
 /**
  * {@inheritDoc}
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['use_form_label'])) {
         $this->setUseFormLabel($options['use_form_label']);
     }
     if (array_key_exists('form_timeout', $options)) {
         $this->setFormTimeout($options['form_timeout']);
         if (null !== $options['form_timeout'] && !isset($options['use_csrf'])) {
             $options['use_csrf'] = true;
         }
     }
     if (isset($options['use_csrf'])) {
         $this->setUseCsrf($options['use_csrf']);
     }
     if (!empty($options['captcha_options'])) {
         $this->setCaptchaOptions($options['captcha_options']);
         if (!isset($options['use_captcha'])) {
             $options['use_captcha'] = true;
         }
     }
     if (isset($options['use_captcha'])) {
         $this->setUseCaptcha($options['use_captcha']);
     }
     if (isset($options['use_submit_element'])) {
         $this->setUseSubmitElement($options['use_submit_element']);
     }
     if (isset($options['use_reset_element'])) {
         $this->setUseResetElement($options['use_reset_element']);
     }
     if (isset($options['merge_input_filter'])) {
         $this->setMergeInputFilter($options['merge_input_filter']);
     }
     if (isset($options['priority_step'])) {
         $this->setPriorityStep($options['priority_step']);
     }
     if (isset($options['element_group'])) {
         $this->setElementGroup($options['element_group'], false);
     }
     return $this;
 }