function olivero_test_preprocess_page in Drupal 10
Implements hook_preprocess().
File
- core/
modules/ system/ tests/ modules/ olivero_test/ olivero_test.module, line 21 - Functions to support testing the Olivero theme.
Code
function olivero_test_preprocess_page(&$variables) {
$route = \Drupal::routeMatch()
->getRouteName();
switch ($route) {
case 'js_message_test.links':
$messenger = \Drupal::messenger();
$messenger
->addStatus('PHP Status');
$messenger
->addWarning('PHP Warning');
$messenger
->addError('PHP Error');
break;
default:
break;
}
}