You are here

public function RequestPathExclusion::evaluate in Context 8.4

Same name and namespace in other branches
  1. 8 src/Plugin/Condition/RequestPathExclusion.php \Drupal\context\Plugin\Condition\RequestPathExclusion::evaluate()

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

bool TRUE if the condition has been met, FALSE otherwise.

Overrides RequestPath::evaluate

File

src/Plugin/Condition/RequestPathExclusion.php, line 47

Class

RequestPathExclusion
Provides a 'Request path exclusion' condition.

Namespace

Drupal\context\Plugin\Condition

Code

public function evaluate() {

  // As a failsafe, ensure it's always set to negate before evaluating.
  $this->configuration['negate'] = TRUE;

  // Allow this to pass through gracefully when blank.
  $pages = mb_strtolower($this->configuration['pages']);
  if (!$pages) {
    return FALSE;
  }
  return parent::evaluate();
}