You are here

function Php::validate_argument in Views (for Drupal 7) 8.3

Overrides ArgumentValidatorPluginBase::validate_argument

File

lib/Drupal/views/Plugin/views/argument_validator/Php.php, line 52
Definition of Drupal\views\Plugin\views\argument_validator\Php.

Class

Php
Provide PHP code to validate whether or not an argument is ok.

Namespace

Drupal\views\Plugin\views\argument_validator

Code

function validate_argument($argument) {

  // set up variables to make it easier to reference during the argument.
  $view =& $this->view;
  $handler =& $this->argument;
  ob_start();
  $result = eval($this->options['code']);
  ob_end_clean();
  return $result;
}