You are here

public function LanguageCookieConditionIndexPhp::evaluate in Language Cookie 8

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

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

Overrides LanguageCookieConditionBase::evaluate

File

src/Plugin/LanguageCookieCondition/LanguageCookieConditionIndexPhp.php, line 22

Class

LanguageCookieConditionIndexPhp
Class for the Index.php condition plugin.

Namespace

Drupal\language_cookie\Plugin\LanguageCookieCondition

Code

public function evaluate() {
  if ($_SERVER['SCRIPT_NAME'] !== $GLOBALS['base_path'] . 'index.php') {
    return $this
      ->block();
  }
  return $this
    ->pass();
}