You are here

public function ConfigPagesBlock::blockSubmit in Config Pages 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/Block/ConfigPagesBlock.php \Drupal\config_pages\Plugin\Block\ConfigPagesBlock::blockSubmit()
  2. 8.2 src/Plugin/Block/ConfigPagesBlock.php \Drupal\config_pages\Plugin\Block\ConfigPagesBlock::blockSubmit()

Adds block type-specific submission handling for the block form.

Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm().

Parameters

array $form: The form definition array for the full block configuration form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides BlockPluginTrait::blockSubmit

See also

\Drupal\Core\Block\BlockPluginInterface::blockForm()

\Drupal\Core\Block\BlockPluginInterface::blockValidate()

File

src/Plugin/Block/ConfigPagesBlock.php, line 161

Class

ConfigPagesBlock
Provides a generic ConfigPages block.

Namespace

Drupal\config_pages\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $this
    ->setConfigurationValue('config_page_type', $form_state
    ->getValue('config_page_type'));
  $this
    ->setConfigurationValue('config_page_view_mode', $form_state
    ->getValue('config_page_view_mode'));
}