You are here

public function CustomTextComponentType::addComponentFormSubmit in Flexiform 8

Submit the add component options form.

Make sure the desired options values are set to the same parents as the supplied form element.

Parameters

array $form: The part of the form array that should contain the component plugin settings.

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

Overrides FormComponentTypeCreateableBase::addComponentFormSubmit

File

src/Plugin/FormComponentType/CustomTextComponentType.php, line 83

Class

CustomTextComponentType
Plugin for field widget component types.

Namespace

Drupal\flexiform\Plugin\FormComponentType

Code

public function addComponentFormSubmit(array $form, FormStateInterface $form_state) {
  $options = $form_state
    ->getValue($form['#parents']);
  $options['format'] = $options['content']['format'];
  $options['content'] = $options['content']['value'];
  $form_state
    ->setValue($form['#parents'], $options);
}