You are here

public static function StatusMessages::generatePlaceholder in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Render/Element/StatusMessages.php \Drupal\Core\Render\Element\StatusMessages::generatePlaceholder()

#pre_render callback to generate a placeholder.

Parameters

array $element: A renderable array.

Return value

array The updated renderable array containing the placeholder.

File

core/lib/Drupal/Core/Render/Element/StatusMessages.php, line 43
Contains \Drupal\Core\Render\Element\StatusMessages.

Class

StatusMessages
Provides a messages element.

Namespace

Drupal\Core\Render\Element

Code

public static function generatePlaceholder(array $element) {
  $element['messages_placeholder'] = [
    '#lazy_builder' => [
      get_class() . '::renderMessages',
      [
        $element['#display'],
      ],
    ],
    '#create_placeholder' => TRUE,
  ];
  return $element;
}