public function views_php_handler_filter::php_pre_execute in Views PHP 7
Same name and namespace in other branches
- 6 plugins/views/views_php_handler_filter.inc \views_php_handler_filter::php_pre_execute()
- 7.2 plugins/views/views_php_handler_filter.inc \views_php_handler_filter::php_pre_execute()
See also
File
- plugins/
views/ views_php_handler_filter.inc, line 67
Class
- views_php_handler_filter
- A handler to filter a view using PHP defined by the administrator.
Code
public function php_pre_execute() {
// Execute 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();
}
}