function ThemeTestHooks::systemInfoAlter

Implements hook_system_info_alter().

Attributes

#[Hook('system_info_alter')]

See also

\Drupal\system\Tests\Theme\ThemeInfoTest::testChanges()

File

core/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php, line 104

Class

ThemeTestHooks
Hook implementations for theme_test.

Namespace

Drupal\theme_test\Hook

Code

public function systemInfoAlter(array &$info, Extension $file, $type) : void {
  if ($type == 'theme' && $file->getName() == 'test_theme' && \Drupal::state()->get('theme_test.modify_info_files')) {
    // Add a library to see if the system picks it up.
    $info += [
      'libraries' => [],
    ];
    $info['libraries'][] = 'core/once';
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.