class ThemeSuggestionsTestHooks
Hook implementations for theme_suggestions_test.
Hierarchy
- class \Drupal\theme_suggestions_test\Hook\ThemeSuggestionsTestHooks
Expanded class hierarchy of ThemeSuggestionsTestHooks
File
-
core/
modules/ system/ tests/ modules/ theme_suggestions_test/ src/ Hook/ ThemeSuggestionsTestHooks.php, line 12
Namespace
Drupal\theme_suggestions_test\HookView source
class ThemeSuggestionsTestHooks {
/**
* Implements hook_theme_suggestions_alter().
*/
public function themeSuggestionsAlter(array &$suggestions, array &$variables, $hook) {
\Drupal::messenger()->addStatus('theme_suggestions_test_theme_suggestions_alter' . '() executed.');
if ($hook == 'theme_test_general_suggestions') {
$suggestions[] = $hook . '__module_override';
$variables['module_hook'] = 'theme_suggestions_test_theme_suggestions_alter';
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
public function themeSuggestionsThemeTestSuggestionsAlter(array &$suggestions, array $variables) {
\Drupal::messenger()->addStatus('theme_suggestions_test_theme_suggestions_theme_test_suggestions_alter' . '() executed.');
$suggestions[] = 'theme_test_suggestions__module_override';
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
public function themeSuggestionsThemeTestSpecificSuggestionsAlter(array &$suggestions, array $variables) {
$suggestions[] = 'theme_test_specific_suggestions__variant__foo';
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ThemeSuggestionsTestHooks::themeSuggestionsAlter | public | function | Implements hook_theme_suggestions_alter(). |
ThemeSuggestionsTestHooks::themeSuggestionsThemeTestSpecificSuggestionsAlter | public | function | Implements hook_theme_suggestions_HOOK_alter(). |
ThemeSuggestionsTestHooks::themeSuggestionsThemeTestSuggestionsAlter | public | function | Implements hook_theme_suggestions_HOOK_alter(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.