public function EditViewsCustomTable::validateForm in Views Custom Table 8
Same name and namespace in other branches
- 9.0.x src/Form/EditViewsCustomTable.php \Drupal\view_custom_table\Form\EditViewsCustomTable::validateForm()
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- src/
Form/ EditViewsCustomTable.php, line 111
Class
- EditViewsCustomTable
- Edit views custom table form.
Namespace
Drupal\view_custom_table\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$description = $form_state
->getValue('description');
if (strlen($description) > 254) {
$form_state
->setErrorByName('description', $this
->t("Description can not be more then 255 letters. Please update it and try again."));
}
}