You are here

public function FontSelectionImageEffect::submitConfigurationForm in Image Effects 8.3

Same name and namespace in other branches
  1. 8 tests/modules/image_effects_module_test/src/Plugin/ImageEffect/FontSelectionImageEffect.php \Drupal\image_effects_module_test\Plugin\ImageEffect\FontSelectionImageEffect::submitConfigurationForm()
  2. 8.2 tests/modules/image_effects_module_test/src/Plugin/ImageEffect/FontSelectionImageEffect.php \Drupal\image_effects_module_test\Plugin\ImageEffect\FontSelectionImageEffect::submitConfigurationForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides ConfigurableImageEffectBase::submitConfigurationForm

File

tests/modules/image_effects_module_test/src/Plugin/ImageEffect/FontSelectionImageEffect.php, line 86

Class

FontSelectionImageEffect
Image effect that relies on a font URI selected via the font selector plugin.

Namespace

Drupal\image_effects_module_test\Plugin\ImageEffect

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  $this->configuration['font_uri'] = $form_state
    ->getValue('font_uri');
  $this->configuration['font_name'] = $this->fontSelector
    ->getDescription($form_state
    ->getValue('font_uri'));
}