You are here

public function SiteInfoBlock::blockForm in Express 8

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 The renderable form array representing the entire configuration form.

Overrides BlockPluginTrait::blockForm

File

modules/custom/express_site_info/src/Plugin/Block/SiteInfoBlock.php, line 52

Class

SiteInfoBlock
Provides the Express Site Info Block.

Namespace

Drupal\express_site_info\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $config = $this
    ->getConfiguration();
  $form['express_site_info_contact_info'] = array(
    '#type' => 'textarea',
    '#title' => $this
      ->t('Express Site Info Contact Information'),
    '#description' => $this
      ->t('This will display as contact information for your visitors.'),
    '#default_value' => isset($config['contact_info']) ? $config['contact_info'] : '',
  );
  return $form;
}