You are here

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

Class

LanguageSelectionPageConditionType
Class for the Type condition plugin.

Namespace

Drupal\language_selection_page\Plugin\LanguageSelectionPageCondition

Code

public function evaluate() {

  // Do not return any language if we use Drupal's block method
  // to display the redirection.
  // Be aware that this will automatically assign the default language.
  if ($this->configuration[$this
    ->getPluginId()] === 'block') {
    return $this
      ->block();
  }
  return $this
    ->pass();
}