You are here

public function ForwardLinkBlock::blockForm in Forward 8.2

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/ForwardLinkBlock.php, line 112

Class

ForwardLinkBlock
Provides a block with a Forward link.

Namespace

Drupal\forward\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $config = $this->configuration;
  $form['body'] = [
    '#type' => 'text_format',
    '#title' => $this
      ->t('Body'),
    '#description' => $this
      ->t('If set, this is placed in the block before the link.'),
  ];
  if (isset($config['body']['value'])) {
    $form['body']['#default_value'] = $config['body']['value'];
    $form['body']['#format'] = $config['body']['format'];
  }
  return $form;
}