You are here

function fontyourface_module_implements_alter in @font-your-face 8.3

Implements hook_module_implements_alter().

File

./fontyourface.module, line 24
Contains fontyourface.module..

Code

function fontyourface_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'page_attachments') {

    // Move the fontyourface and submodules to be last to build on page.
    $list = [
      'fontyourface',
    ];
    foreach (\Drupal::moduleHandler()
      ->getImplementations('fontyourface_api') as $module_name) {
      if (isset($implementations[$module_name])) {
        $list[] = $module_name;
      }
    }
    foreach ($list as $module_name) {
      $group = $implementations[$module_name];
      unset($implementations[$module_name]);
      $implementations[$module_name] = $group;
    }
  }
}