You are here

public function LanguageSelectionPageConditionXMLHTTPRequest::evaluate in Language Selection Page 8.2

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

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

Overrides LanguageSelectionPageConditionBase::evaluate

File

src/Plugin/LanguageSelectionPageCondition/LanguageSelectionPageConditionXMLHTTPRequest.php, line 63

Class

LanguageSelectionPageConditionXMLHTTPRequest
Class for LanguageSelectionPageConditionXMLHTTPRequest.

Namespace

Drupal\language_selection_page\Plugin\LanguageSelectionPageCondition

Code

public function evaluate() {
  if ($this->requestStack
    ->getCurrentRequest()
    ->isXmlHttpRequest()) {
    return $this
      ->block();
  }
  return $this
    ->pass();
}