function Page::submitOptionsForm

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

Overrides PathPluginBase::submitOptionsForm

File

core/modules/views/src/Plugin/views/display/Page.php, line 485

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
    parent::submitOptionsForm($form, $form_state);
    switch ($form_state->get('section')) {
        case 'menu':
            $menu = $form_state->getValue('menu');
            [
                $menu['menu_name'],
                $menu['parent'],
            ] = explode(':', $menu['parent'], 2);
            $this->setOption('menu', $menu);
            // send ajax form to options page if we use it.
            if ($form_state->getValue([
                'menu',
                'type',
            ]) == 'default tab') {
                $form_state->get('view')
                    ->addFormToStack('display', $this->display['id'], 'tab_options');
            }
            break;
        case 'tab_options':
            $this->setOption('tab_options', $form_state->getValue('tab_options'));
            break;
    }
}

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