You are here

function mgv_template_preprocess_default_variables_alter in More Global Variables 8

Implements hook_template_preprocess_default_variables_alter().

File

./mgv.module, line 104
Create global variables to be printed in any template like so {{ variable }}.

Code

function mgv_template_preprocess_default_variables_alter(&$variables) {

  /* @var \Drupal\mgv\MgvPluginManager $variables_manager */
  $variables_manager = \Drupal::service('plugin.manager.mgv');
  $variables['global_variables'] = $variables_manager
    ->getVariables();
}