You are here

public function FlagEditForm::buildForm in Flag 8.4

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 FlagFormBase::buildForm

File

src/Form/FlagEditForm.php, line 20

Class

FlagEditForm
Provides the flag edit form.

Namespace

Drupal\flag\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $entity_type = NULL) {
  $form = parent::buildForm($form, $form_state);
  $form['global']['#disabled'] = TRUE;
  $form['global']['#description'] = $this
    ->t('The scope cannot be changed on existing flags.');
  return $form;
}