You are here

public function FieldGroupAddForm::validateFormatterSelection in Field Group 8

Same name and namespace in other branches
  1. 8.3 src/Form/FieldGroupAddForm.php \Drupal\field_group\Form\FieldGroupAddForm::validateFormatterSelection()

Validate the formatter selection step.

File

src/Form/FieldGroupAddForm.php, line 212

Class

FieldGroupAddForm
Provides a form for adding a fieldgroup to a bundle.

Namespace

Drupal\field_group\Form

Code

public function validateFormatterSelection(array &$form, FormStateInterface $form_state) {
  $group_name = self::GROUP_PREFIX . $form_state
    ->getValue('group_name');

  // Add the prefix.
  $form_state
    ->setValueForElement($form['new_group_wrapper']['group_name'], $group_name);
}