public function Wordcount::isNumeric in CKEditor Wordcount 8
Same name and namespace in other branches
- 2.x src/Plugin/CKEditorPlugin/Wordcount.php \Drupal\ckwordcount\Plugin\CKEditorPlugin\Wordcount::isNumeric()
Validation function for the settings form.
Parameters
array $element: An associative array containing the properties and children of the generic form element.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
File
- src/
Plugin/ CKEditorPlugin/ Wordcount.php, line 167
Class
- Wordcount
- Defines the "wordcount" plugin.
Namespace
Drupal\ckwordcount\Plugin\CKEditorPluginCode
public function isNumeric(array $element, FormStateInterface $form_state) {
if (!is_numeric($element['#value'])) {
$form_state
->setError($element, 'Value must be a number.');
}
}