function protected function PreprocessBase::preprocessAttributes

8.x-3.x PreprocessBase.php protected PreprocessBase::preprocessAttributes()

Ensures all attributes have been converted to an Attribute object.

Class

PreprocessBase
Base preprocess class used to build the necessary variables for templates.

Namespace

Drupal\bootstrap\Plugin\Preprocess

Source src/Plugin/Preprocess/PreprocessBase.php (line 59)

protected function preprocessAttributes() {
  foreach ($this->variables as $name => $value) {
    if (strpos($name, 'attributes') !== FALSE && is_array($value)) {
      $this->variables[$name] = new Attribute($value);
    }
  }
}