public function Php::validateArgument in PHP 8
Performs validation for a given argument.
Overrides ArgumentValidatorPluginBase::validateArgument
File
- src/
Plugin/ views/ argument_validator/ Php.php, line 57
Class
- Php
- Provide PHP code to validate whether or not an argument is ok.
Namespace
Drupal\php\Plugin\views\argument_validatorCode
public function validateArgument($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;
}