You are here

public function AddToHomeScreenBlock::blockForm in Progressive Web App 8

Overrides BlockPluginTrait::blockForm

File

modules/pwa_a2hs/src/Plugin/Block/AddToHomeScreenBlock.php, line 31

Class

AddToHomeScreenBlock
Provides an Add to Home Screen block.

Namespace

Drupal\pwa_a2hs\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form['intro_text'] = [
    '#type' => 'text_format',
    '#title' => $this
      ->t('Introduction text'),
    '#format' => $this->configuration['intro_text']['format'],
    '#default_value' => $this->configuration['intro_text']['value'],
    '#weight' => '1',
  ];
  $form['button_text'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Button text'),
    '#default_value' => $this->configuration['button_text'],
    '#weight' => '2',
  ];
  return $form;
}