You are here

function views_php_handler_filter::php_pre_execute in Views PHP 7.2

Same name and namespace in other branches
  1. 6 plugins/views/views_php_handler_filter.inc \views_php_handler_filter::php_pre_execute()
  2. 7 plugins/views/views_php_handler_filter.inc \views_php_handler_filter::php_pre_execute()

See also

views_php_views_pre_execute()

File

plugins/views/views_php_handler_filter.inc, line 65

Class

views_php_handler_filter
A handler to filter a view using PHP defined by the administrator.

Code

function php_pre_execute() {

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