You are here

public function ExampleConfigurableTextBlock::blockSubmit in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/block_example/src/Plugin/Block/ExampleConfigurableTextBlock.php \Drupal\block_example\Plugin\Block\ExampleConfigurableTextBlock::blockSubmit()

This method processes the blockForm() form fields when the block configuration form is submitted.

The blockValidate() method can be used to validate the form submission.

Overrides BlockPluginTrait::blockSubmit

File

block_example/src/Plugin/Block/ExampleConfigurableTextBlock.php, line 68

Class

ExampleConfigurableTextBlock
Provides a 'Example: configurable text string' block.

Namespace

Drupal\block_example\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $this->configuration['block_example_string'] = $form_state
    ->getValue('block_example_string_text');
}