You are here

protected function PatternBase::processVariables in UI Patterns 8

Process theme variables.

Parameters

\Drupal\ui_patterns\Definition\PatternDefinition $definition: Pattern definition array.

Return value

array Processed hook definition portion.

1 call to PatternBase::processVariables()
PatternBase::getThemeImplementation in src/Plugin/PatternBase.php
Get theme implementation for current pattern.

File

src/Plugin/PatternBase.php, line 153

Class

PatternBase
Class PatternBase.

Namespace

Drupal\ui_patterns\Plugin

Code

protected function processVariables(PatternDefinition $definition) {
  $return = [];
  foreach ($definition
    ->getFields() as $field) {
    $return['variables'][$field
      ->getName()] = NULL;
  }
  $return['variables']['attributes'] = [];
  $return['variables']['context'] = [];
  $return['variables']['variant'] = '';
  $return['variables']['use'] = '';
  return $return;
}