You are here

public function WizardForm::form in Flexiform 8

Gets the actual form array to be built.

Overrides EntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

1 call to WizardForm::form()
WizardEditForm::form in contrib/wizard/src/Form/WizardEditForm.php
Gets the actual form array to be built.
1 method overrides WizardForm::form()
WizardEditForm::form in contrib/wizard/src/Form/WizardEditForm.php
Gets the actual form array to be built.

File

contrib/wizard/src/Form/WizardForm.php, line 16

Class

WizardForm
Form to configure flexiform wizards.

Namespace

Drupal\flexiform_wizard\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $entity = $this->entity;
  $form['label'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Wizard Name'),
    '#default_value' => $entity
      ->label(),
    '#size' => 30,
    '#required' => TRUE,
    '#maxlength' => 64,
    '#description' => $this
      ->t('The name of this wizard.'),
  ];
  $form['id'] = [
    '#type' => 'machine_name',
    '#default_value' => $entity
      ->id(),
    '#required' => TRUE,
    '#disabled' => !$entity
      ->isNew(),
    '#size' => 30,
    '#maxlength' => 64,
    '#machine_name' => [
      'exists' => [
        '\\Drupal\\flexiform_wizard\\Entity\\Wizard',
        'load',
      ],
    ],
  ];
  $form['path'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Path'),
    '#default_value' => $entity
      ->get('path'),
    '#required' => TRUE,
    '#description' => $this
      ->t('The path the wizard should reside at.'),
  ];
  return $form;
}