You are here

public function FontCKEditorButton::validateFontSizeValue in CKEditor Font Size and Family 8

#element_validate handler for the "font" element in settingsForm().

Parameters

array $element:

FormStateInterface $form_state:

File

src/Plugin/CKEditorPlugin/FontCKEditorButton.php, line 190

Class

FontCKEditorButton
Defines the "font" plugin.

Namespace

Drupal\ckeditor_font\Plugin\CKEditorPlugin

Code

public function validateFontSizeValue(array $element, FormStateInterface $form_state) {
  if ($this
    ->generateFontStyleSetting($element['#value'], 'size') === FALSE) {
    $form_state
      ->setError($element, t('The provided list of font sizes is syntactically incorrect.'));
  }
}