You are here

public function PanelizerWizardGeneralForm::validateForm in Panelizer 8.4

Same name and namespace in other branches
  1. 8.5 src/Form/PanelizerWizardGeneralForm.php \Drupal\panelizer\Form\PanelizerWizardGeneralForm::validateForm()
  2. 8.3 src/Form/PanelizerWizardGeneralForm.php \Drupal\panelizer\Form\PanelizerWizardGeneralForm::validateForm()

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

src/Form/PanelizerWizardGeneralForm.php, line 136

Class

PanelizerWizardGeneralForm
General settings for a panelized bundle.

Namespace

Drupal\panelizer\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->hasValue('id') && !isset($this->machine_name) && $form_state
    ->has('machine_name_prefix')) {
    $form_state
      ->setValue('id', "{$form_state->get('machine_name_prefix')}__{$form_state->getValue('id')}");
  }
}