public function Block::blockSubmit in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block::blockSubmit()
 
Handles form submission for the views block configuration form.
Parameters
\Drupal\views\Plugin\Block\ViewsBlock $block: The ViewsBlock plugin.
array $form: The form definition array for the full block configuration form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
See also
\Drupal\views\Plugin\Block\ViewsBlock::blockSubmit()
File
- core/
modules/ views/ src/ Plugin/ views/ display/ Block.php, line 351  
Class
- Block
 - The plugin that handles a block.
 
Namespace
Drupal\views\Plugin\views\displayCode
public function blockSubmit(ViewsBlock $block, $form, FormStateInterface $form_state) {
  if ($items_per_page = $form_state
    ->getValue([
    'override',
    'items_per_page',
  ])) {
    $block
      ->setConfigurationValue('items_per_page', $items_per_page);
  }
  $form_state
    ->unsetValue([
    'override',
    'items_per_page',
  ]);
}