You are here

public function ViewsPhp::phpPreExecute in Views PHP 8

Same name in this branch
  1. 8 src/Plugin/views/filter/ViewsPhp.php \Drupal\views_php\Plugin\views\filter\ViewsPhp::phpPreExecute()
  2. 8 src/Plugin/views/sort/ViewsPhp.php \Drupal\views_php\Plugin\views\sort\ViewsPhp::phpPreExecute()
  3. 8 src/Plugin/views/field/ViewsPhp.php \Drupal\views_php\Plugin\views\field\ViewsPhp::phpPreExecute()

See also

views_php_views_pre_execute()

self::php_post_execute()

File

src/Plugin/views/field/ViewsPhp.php, line 165
Contains \Drupal\views_php\Plugin\views\field\ViewsPhp.

Class

ViewsPhp
A handler to provide a field that is constructed by the administrator using PHP.

Namespace

Drupal\views_php\Plugin\views\field

Code

public function phpPreExecute() {

  // Execute static PHP code.
  if (!empty($this->options['php_setup'])) {
    $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
    ob_start();
    $function($this->view, $this, $this->php_static_variable);
    ob_end_clean();
  }
}