function Attachment::submitOptionsForm

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Attachment.php \Drupal\views\Plugin\views\display\Attachment::submitOptionsForm()
  2. 10 core/modules/views/src/Plugin/views/display/Attachment.php \Drupal\views\Plugin\views\display\Attachment::submitOptionsForm()
  3. 11.x core/modules/views/src/Plugin/views/display/Attachment.php \Drupal\views\Plugin\views\display\Attachment::submitOptionsForm()

Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

Overrides DisplayPluginBase::submitOptionsForm

File

core/modules/views/src/Plugin/views/display/Attachment.php, line 217

Class

Attachment
The plugin that handles an attachment display.

Namespace

Drupal\views\Plugin\views\display

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
    // It is very important to call the parent function here:
    parent::submitOptionsForm($form, $form_state);
    $section = $form_state->get('section');
    switch ($section) {
        case 'displays':
            $form_state->setValue($section, array_filter($form_state->getValue($section)));
        case 'inherit_arguments':
        case 'inherit_pager':
        case 'render_pager':
        case 'inherit_exposed_filters':
        case 'attachment_position':
            $this->setOption($section, $form_state->getValue($section));
            break;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.