function olivero_test_preprocess_page
Implements hook_preprocess().
File
- 
              core/
modules/ system/ tests/ modules/ olivero_test/ olivero_test.module, line 21  
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;
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.