You are here

public function ForumBlockBase::blockForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/src/Plugin/Block/ForumBlockBase.php \Drupal\forum\Plugin\Block\ForumBlockBase::blockForm()

Returns the configuration form elements specific to this block plugin.

Blocks that need to add form elements to the normal block configuration form should implement this method.

Parameters

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

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

Return value

array $form The renderable form array representing the entire configuration form.

Overrides BlockBase::blockForm

File

core/modules/forum/src/Plugin/Block/ForumBlockBase.php, line 69
Contains \Drupal\forum\Plugin\Block\ForumBlockBase.

Class

ForumBlockBase
Provides a base class for Forum blocks.

Namespace

Drupal\forum\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $range = range(2, 20);
  $form['block_count'] = array(
    '#type' => 'select',
    '#title' => $this
      ->t('Number of topics'),
    '#default_value' => $this->configuration['block_count'],
    '#options' => array_combine($range, $range),
  );
  return $form;
}