You are here

public function SwitchForm::buildForm in Domain Access 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 FormInterface::buildForm

File

domain_config_ui/src/Form/SwitchForm.php, line 74

Class

SwitchForm
Class SwitchForm.

Namespace

Drupal\domain_config_ui\Form

Code

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

  // Only allow access to domain administrators.
  $form['#access'] = $this
    ->canUseDomainConfig();
  $form = $this
    ->addSwitchFields($form, $form_state);
  return $form;
}