You are here

public function ConfigForm::buildForm in Node.js integration 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

nodejs_notify/src/Form/ConfigForm.php, line 23

Class

ConfigForm
Class ConfigForm

Namespace

Drupal\nodejs_notify\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('nodejs_notify.settings');
  $form['notification_lifetime_seconds'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Notification lifetime'),
    '#description' => $this
      ->t('The number of seconds a notification will live before fading automatically. (Set to 0 for sticky notifications that do not fade.)'),
    '#default_value' => $config
      ->get('notification_lifetime_seconds'),
  ];
  return parent::buildForm($form, $form_state);
}