You are here

public function SortPluginBase::adminSummary in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::adminSummary()

Display whether or not the sort order is ascending or descending

Overrides HandlerBase::adminSummary

File

core/modules/views/src/Plugin/views/sort/SortPluginBase.php, line 60

Class

SortPluginBase
Base sort handler that has no options and performs a simple sort.

Namespace

Drupal\views\Plugin\views\sort

Code

public function adminSummary() {
  if (!empty($this->options['exposed'])) {
    return $this
      ->t('Exposed');
  }
  switch ($this->options['order']) {
    case 'ASC':
    case 'asc':
    default:
      return $this
        ->t('asc');
    case 'DESC':
    case 'desc':
      return $this
        ->t('desc');
  }
}