public function TestBlockInstantiation::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.

array $form_state: An array containing the current state of the configuration form.

Return value

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

Overrides BlockBase::blockForm

See also

\Drupal\block\BlockBase::form()

File

drupal/core/modules/block/tests/lib/Drupal/block_test/Plugin/Block/TestBlockInstantiation.php, line 44
Contains \Drupal\block_test\Plugin\Block\TestBlockInstantiation.

Class

TestBlockInstantiation
Provides a basic block for testing block instantiation and configuration.

Namespace

Drupal\block_test\Plugin\Block

Code

public function blockForm($form, &$form_state) {
  $form['display_message'] = array(
    '#type' => 'textfield',
    '#title' => t('Display message'),
    '#default_value' => $this->configuration['display_message'],
  );
  return $form;
}