You are here

public function M4032404Form::buildForm in 403 to 404 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/M4032404Form.php, line 25

Class

M4032404Form
Class M4032404Form.

Namespace

Drupal\m4032404\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $m4032404_admin_only = $this
    ->config('m4032404.settings')
    ->get('admin_only');
  $form['m4032404_admin_only'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enforce on Admin Only'),
    '#description' => $this
      ->t('Check the box to enforce the 404 behavior only on admin paths'),
    '#default_value' => $m4032404_admin_only,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Save configuration'),
  );
  return $form;
}