You are here

public function LanguageCookieConditionServerAddr::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/LanguageCookieConditionServerAddr.php, line 22

Class

LanguageCookieConditionServerAddr
Class for the Server Addr condition plugin.

Namespace

Drupal\language_cookie\Plugin\LanguageCookieCondition

Code

public function evaluate() {
  if (isset($_SERVER['SERVER_ADDR'])) {
    return $this
      ->pass();
  }
  return $this
    ->block();
}