You are here

public function Table::preprocessVariables in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  2. 8 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  3. 8.2 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  4. 8.3 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  5. 8.4 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  6. 8.5 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  7. 8.6 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()
  8. 8.7 themes/socialbase/src/Plugin/Preprocess/Table.php \Drupal\socialbase\Plugin\Preprocess\Table::preprocessVariables()

Preprocess the variables array.

Parameters

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

Overrides Table::preprocessVariables

File

themes/socialbase/src/Plugin/Preprocess/Table.php, line 20

Class

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

Namespace

Drupal\socialbase\Plugin\Preprocess

Code

public function preprocessVariables(Variables $variables) {
  if (isset($variables['attributes']['id']) && strpos($variables['attributes']['id'], 'edit-field-files') !== FALSE) {
    $variables['attributes']['class'][] = 'tablesaw';
    $variables['attributes']['data-tablesaw-mode'] = 'stack';
  }
  parent::preprocessVariables($variables);
}