components_test.module in Components! 3.x
Same filename and directory in other branches
Test module.
File
tests/modules/components_test/components_test.moduleView source
<?php
/**
* @file
* Test module.
*/
/**
* Implements hook_theme().
*/
function components_test_theme($existing, $type, $theme, $path) : array {
$items['components_test'] = [
'variables' => [],
];
return $items;
}
/**
* Implements hook_components_namespaces_alter().
*/
function components_test_components_namespaces_alter(array &$namespaces, string $theme) {
if ($theme === 'components_test_theme') {
$namespaces['components'][] = drupal_get_path('module', 'components_test') . '/components-alt';
}
}
/**
* Implements hook_protected_twig_namespaces_alter().
*/
function components_test_protected_twig_namespaces_alter(array &$protectedNamespaces) {
// Allow the "system" Twig namespace to be altered.
unset($protectedNamespaces['system']);
}
Functions
Name | Description |
---|---|
components_test_components_namespaces_alter | Implements hook_components_namespaces_alter(). |
components_test_protected_twig_namespaces_alter | Implements hook_protected_twig_namespaces_alter(). |
components_test_theme | Implements hook_theme(). |