You are here

public function SettingsForm::buildForm in Moderation Dashboard 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/SettingsForm.php \Drupal\moderation_dashboard\Form\SettingsForm::buildForm()

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 30

Class

SettingsForm
The settings form for Moderation Dashboard.

Namespace

Drupal\moderation_dashboard\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('moderation_dashboard.settings');
  $form['redirect_on_login'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Redirect on login'),
    '#default_value' => $config
      ->get('redirect_on_login'),
    '#description' => $this
      ->t('Redirect to moderation dashboard after login.'),
  ];
  return parent::buildForm($form, $form_state);
}