You are here

public function SettingsForm::buildForm in Production check & Production monitor 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 44

Class

SettingsForm
Settings form for production check.

Namespace

Drupal\prod_check\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // E-mail settings.
  $form['prod_check_general'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('General settings'),
    '#description' => $this
      ->t('Settings to allow certain checks to function properly.'),
    '#open' => TRUE,
  ];
  $form['prod_check_general']['site_email'] = [
    '#type' => 'textfield',
    '#title' => t('Mail check'),
    '#default_value' => $this
      ->config('prod_check.settings')
      ->get('site_email'),
    '#size' => 60,
    '#description' => $this
      ->t('Enter (part of) the e-mail address you always <strong>use when developing</strong> a website. This is used in a regular expression in the "Site e-mail", Contact and Webform modules check.'),
  ];
  return parent::buildForm($form, $form_state);
}