function public function Table::preprocessVariables

8.x-3.x Table.php public Table::preprocessVariables(Variables $variables)

Preprocess the variables array.

Parameters

\Drupal\bootstrap\Utility\Variables $variables: The Variables object.

Overrides PreprocessBase::preprocessVariables

Class

Table
Pre-processes variables for the "table" theme hook.

Namespace

Drupal\bootstrap\Plugin\Preprocess

Source src/Plugin/Preprocess/Table.php (line 19)

public function preprocessVariables(Variables $variables) {
  // Bordered.
  $variables['bordered'] = !!$variables->getContext('bordered', $this->theme->getSetting('table_bordered'));

  // Condensed.
  $variables['condensed'] = !!$variables->getContext('condensed', $this->theme->getSetting('table_condensed'));

  // Hover.
  $variables['hover'] = !!$variables->getContext('hover', $this->theme->getSetting('table_hover'));

  // Striped.
  $variables['striped'] = empty($variables['no_striping']) && $variables->getContext('striped', $this->theme->getSetting('table_striped'));
  unset($variables['no_striping']);

  // Responsive.
  $responsive = $variables->getContext('responsive', $this->theme->getSetting('table_responsive'));
  $variables['responsive'] = $responsive == -1 ? !\Drupal::service('router.admin_context')->isAdminRoute() : !!(int) $responsive;
}