You are here

public function ProgressBar::preprocessVariables in Express 8

Preprocess the variables array.

Parameters

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

Overrides PreprocessBase::preprocessVariables

File

themes/contrib/bootstrap/src/Plugin/Preprocess/ProgressBar.php, line 25
Contains \Drupal\bootstrap\Plugin\Preprocess\ProgressBar.

Class

ProgressBar
Pre-processes variables for the "progress_bar" theme hook.

Namespace

Drupal\bootstrap\Plugin\Preprocess

Code

public function preprocessVariables(Variables $variables) {

  // Ensure a unique ID, generating one if needed.
  $id = $variables
    ->getAttribute('id', Html::getUniqueId($variables
    ->offsetGet('id', 'progress-bar')));
  $variables
    ->setAttribute('id', $id);
  unset($variables['id']);

  // Preprocess attributes.
  $this
    ->preprocessAttributes();
}