You are here

protected function PageVariantAddWizard::customizeForm in Page Manager 8

Same name and namespace in other branches
  1. 8.4 page_manager_ui/src/Wizard/PageVariantAddWizard.php \Drupal\page_manager_ui\Wizard\PageVariantAddWizard::customizeForm()

Helper function for generating label and id form elements.

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

array

Overrides EntityFormWizardBase::customizeForm

File

page_manager_ui/src/Wizard/PageVariantAddWizard.php, line 119
Contains \Drupal\page_manager_ui\Wizard\PageVariantAddWizard.

Class

PageVariantAddWizard

Namespace

Drupal\page_manager_ui\Wizard

Code

protected function customizeForm(array $form, FormStateInterface $form_state) {
  $form = parent::customizeForm($form, $form_state);

  // We set the variant id as part of form submission.
  if ($this->step == 'type' && isset($form['name']['id'])) {
    unset($form['name']['id']);
  }
  return $form;
}