You are here

public function views_plugin_argument_validate_php::validate_argument in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_argument_validate_php.inc \views_plugin_argument_validate_php::validate_argument()
  2. 6.2 plugins/views_plugin_argument_validate_php.inc \views_plugin_argument_validate_php::validate_argument()

Overrides views_plugin_argument_validate::validate_argument

File

plugins/views_plugin_argument_validate_php.inc, line 60
Definition of views_plugin_argument_validate_php.

Class

views_plugin_argument_validate_php
Provide PHP code to validate whether or not an argument is ok.

Code

public function validate_argument($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;
}