function Block::submitOptionsForm

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block::submitOptionsForm()
  2. 8.9.x core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block::submitOptionsForm()
  3. 10 core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block::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/Block.php, line 259

Class

Block
The plugin that handles a block.

Namespace

Drupal\views\Plugin\views\display

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
    parent::submitOptionsForm($form, $form_state);
    $section = $form_state->get('section');
    switch ($section) {
        case 'block_description':
        case 'block_category':
        case 'allow':
        case 'block_hide_empty':
            $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.