You are here

protected function ViewsDuplicateBuilderBase::getReplacements in Views Templates 8

Get the replaces array from the plugin definition.

The keys will be converted to work with yml files.

Parameters

mixed $options: Options to get replacements.

Return value

array Returns an array.

1 call to ViewsDuplicateBuilderBase::getReplacements()
ViewsDuplicateBuilderBase::alterViewTemplateAfterCreation in src/Plugin/ViewsDuplicateBuilderBase.php
After View Template has been created the Builder should alter it some how.

File

src/Plugin/ViewsDuplicateBuilderBase.php, line 164

Class

ViewsDuplicateBuilderBase
ViewsDuplicateBuilderBase Class.

Namespace

Drupal\views_templates\Plugin

Code

protected function getReplacements($options) {
  if ($replacements = $this
    ->getDefinitionValue('replacements')) {
    $converted_replacements = [];
    foreach ($replacements as $key => $value) {
      $new_key = '__' . strtoupper($key);
      $converted_replacements[$new_key] = $value;
    }
    return $converted_replacements;
  }
  return [];
}