Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SqlBase.php

function SqlBase::exposedFormValidate

Overrides PagerPluginBase::exposedFormValidate

File

core/modules/views/src/Plugin/views/pager/SqlBase.php, line 393

Class

SqlBase
A common base class for sql based pager.

Namespace

Drupal\views\Plugin\views\pager

Code

public function exposedFormValidate(&$form, FormStateInterface $form_state) {
    if (!$form_state->isValueEmpty('offset') && trim($form_state->getValue('offset'))) {
        if (!is_numeric($form_state->getValue('offset')) || $form_state->getValue('offset') < 0) {
            $form_state->setErrorByName('offset', $this->t('Offset must be a number greater than or equal to 0.'));
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal