function ArgumentPluginBase::validateArgument

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::validateArgument()
  2. 10 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::validateArgument()
  3. 11.x core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::validateArgument()

Validate that this argument works. By default, all arguments are valid.

2 calls to ArgumentPluginBase::validateArgument()
ArgumentPluginBase::setArgument in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Set the input for this argument.
ArgumentPluginBase::validateMenuArgument in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Called by the menu system to validate an argument.

File

core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php, line 1007

Class

ArgumentPluginBase
Base class for argument (contextual filter) handler plugins.

Namespace

Drupal\views\Plugin\views\argument

Code

public function validateArgument($arg) {
    // By using % in URLs, arguments could be validated twice; this eases
    // that pain.
    if (isset($this->argument_validated)) {
        return $this->argument_validated;
    }
    if ($this->isException($arg)) {
        return $this->argument_validated = TRUE;
    }
    $plugin = $this->getPlugin('argument_validator');
    return $this->argument_validated = $plugin->validateArgument($arg);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.