function theme_test_system_info_alter

Same name in other branches
  1. 8.9.x core/modules/system/tests/modules/theme_test/theme_test.module \theme_test_system_info_alter()
  2. 10 core/modules/system/tests/modules/theme_test/theme_test.module \theme_test_system_info_alter()

Implements hook_system_info_alter().

See also

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

File

core/modules/system/tests/modules/theme_test/theme_test.module, line 153

Code

function theme_test_system_info_alter(array &$info, Extension $file, $type) {
    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.