function PreprocessHooks::statusMessages
Same name and namespace in other branches
- 11.x core/themes/admin/src/Hook/PreprocessHooks.php \Drupal\admin\Hook\PreprocessHooks::statusMessages()
Implements hook_preprocess_HOOK() for status_messages.
Attributes
#[Hook('preprocess_status_messages')]
File
-
core/
themes/ admin/ src/ Hook/ PreprocessHooks.php, line 1109
Class
- PreprocessHooks
- Provides preprocess implementations.
Namespace
Drupal\admin\HookCode
public function statusMessages(array &$variables) : void {
$variables['title_ids'] = [];
foreach ($variables['message_list'] as $message_type => $messages) {
$variables['title_ids'][$message_type] = Html::getUniqueId("message-{$message_type}-title");
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.