You are here

public static function ClaroPreRender::messagePlaceholder in Drupal 10

Same name and namespace in other branches
  1. 8 core/themes/claro/src/ClaroPreRender.php \Drupal\claro\ClaroPreRender::messagePlaceholder()
  2. 9 core/themes/claro/src/ClaroPreRender.php \Drupal\claro\ClaroPreRender::messagePlaceholder()

Prerender callback for status_messages placeholder.

Parameters

array $element: A renderable array.

Return value

array The updated renderable array containing the placeholder.

File

core/themes/claro/src/ClaroPreRender.php, line 185

Class

ClaroPreRender
Implements trusted prerender callbacks for the Claro theme.

Namespace

Drupal\claro

Code

public static function messagePlaceholder(array $element) {
  if (isset($element['fallback']['#markup'])) {
    $element['fallback']['#markup'] = '<div data-drupal-messages-fallback class="hidden messages-list"></div>';
  }
  return $element;
}