You are here

public function RouteCondition::summary in Route Condition 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Condition/RouteCondition.php \Drupal\route_condition\Plugin\Condition\RouteCondition::summary()

Provides a human readable summary of the condition's configuration.

Overrides ConditionInterface::summary

File

src/Plugin/Condition/RouteCondition.php, line 96

Class

RouteCondition
Provides a 'Route' condition.

Namespace

Drupal\route_condition\Plugin\Condition

Code

public function summary() {
  $routes = array_map('trim', explode("\n", $this->configuration['routes']));
  $routes = implode(', ', $routes);
  if (!empty($this->configuration['negate'])) {
    return $this
      ->t('Do not return true on the following routes: @routes', [
      '@routes' => $routes,
    ]);
  }
  return $this
    ->t('Return true on the following routes: @routes', [
    '@routes' => $routes,
  ]);
}