You are here

public function Php::getArgument in PHP 8

Return the default argument.

This needs to be overridden by every default argument handler to properly do what is needed.

Overrides ArgumentDefaultPluginBase::getArgument

File

src/Plugin/views/argument_default/Php.php, line 58

Class

Php
Default argument plugin to provide a PHP code block.

Namespace

Drupal\php\Plugin\views\argument_default

Code

public function getArgument() {

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