function SortPluginBase::adminSummary

Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::adminSummary()
  2. 10 core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::adminSummary()
  3. 11.x 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 61

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');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.