class TableSortIndicator

Pre-processes variables for the "tablesort_indicator" theme hook.

Plugin annotation



Expanded class hierarchy of TableSortIndicator

Related topics


class TableSortIndicator extends PreprocessBase implements PreprocessInterface {

   * {@inheritdoc}
  public function preprocessVariables(Variables $variables) {
    if ($variables->style === 'asc') {
      $icon = Element::createStandalone(Bootstrap::glyphicon('chevron-down', ['#markup' => $this->t('(asc)')]))
          'data-toggle' => 'tooltip',
          'data-placement' => 'bottom',
          'title' => $this->t('Sort ascending'),
    else {
      $icon = Element::createStandalone(Bootstrap::glyphicon('chevron-up', ['#markup' => $this->t('(desc)')]))
          'data-toggle' => 'tooltip',
          'data-placement' => 'bottom',
          'title' => $this->t('Sort descending'),
    $variables->icon = $icon->getArray();



Contains filters are case sensitive
Name Modifiers Type Description
PluginBase::$theme protected property The currently set theme object.
PluginBase::__construct public function
PreprocessBase::$hook protected property The theme hook invoked.
PreprocessBase::$info protected property The theme hook info array from the theme registry.
PreprocessBase::$variables protected property The Variables object.
PreprocessBase::preprocess public function Preprocess theme hook variables. Overrides PreprocessInterface::preprocess
PreprocessBase::preprocessAttributes protected function Ensures all attributes have been converted to an Attribute object.
PreprocessBase::preprocessDescription protected function Converts any set description variable into a traversable array.
PreprocessBase::preprocessElement protected function Preprocess the variables array if an element is present.
TableSortIndicator::preprocessVariables public function Preprocess the variables array. Overrides PreprocessBase::preprocessVariables