You are here

public function NotificationsWidgetBlock::blockSubmit in Notifications widget 8

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/NotificationsWidgetBlock.php, line 99

Class

NotificationsWidgetBlock
Provides a block with list of notification items.

Namespace

Drupal\notifications_widget\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {

  // Save our custom settings when the form is submitted.
  $this
    ->setConfigurationValue('block_notification_type', $form_state
    ->getValue('block_notification_type'));
  $this
    ->setConfigurationValue('block_notification_logs_display', $form_state
    ->getValue('block_notification_logs_display'));
}