You are here

public function SimplenewsContentSelectionBlock::blockForm in Simplenews Content Selection 8

This method defines form elements for custom block configuration. Standard block configuration fields are added by BlockBase::buildConfigurationForm() (block title and title visibility) and BlockFormController::form() (block visibility settings).

Overrides BlockPluginTrait::blockForm

See also

\Drupal\block\BlockBase::buildConfigurationForm()

\Drupal\block\BlockFormController::form()

File

src/Plugin/Block/SimplenewsContentSelectionBlock.php, line 49

Class

SimplenewsContentSelectionBlock
Provides a 'Simplenews Content Selection' block.

Namespace

Drupal\simplenews_content_selection\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form['simplenews_content_selection_block'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Block contents'),
    '#description' => $this
      ->t('This text will appear in the example block.'),
    '#default_value' => $this->configuration['simplenews_content_selection_block'],
  ];
  return $form;
}