You are here

public function SettingsForm::buildForm in Floating block 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/SettingsForm.php, line 35
Contains \Drupal\floating_block\Form\SettingsForm.

Class

SettingsForm
Defines a form that configures floating_block settings.

Namespace

Drupal\floating_block\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $blocks = $this->configFactory
    ->get('floating_block.settings')
    ->get('blocks');
  $form['blocks'] = array(
    '#type' => 'textarea',
    '#title' => t('Floating block settings'),
    '#default_value' => _floating_block_admin_convert_array_to_text($blocks),
    '#description' => t('Floating block configurations, one per line in the formation <code>[css selector]<strong>|</strong>[extra settings]</code>.'),
  );
  return parent::buildForm($form, $form_state);
}