function views_element_validate_tags

views_element_validate_tags($element, FormStateInterface $form_state)

Validation callback for query tags.

File

core/modules/views/views.module, line 798
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_element_validate_tags($element, FormStateInterface $form_state) {
  $values = array_map('trim', explode(',', $element['#value']));
  foreach ($values as $value) {
    if (preg_match("/[^a-z_]/", $value)) {
      $form_state->setError($element, t('The query tags may only contain lower-case alphabetical characters and underscores.'));
      return;
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!views!views.module/function/views_element_validate_tags/8.1.x