public static StatusMessages::generatePlaceholder(array $element)
#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 47
Class
- StatusMessages
- Provides a messages element.
Namespace
Drupal\Core\Render\Element
Code
public static function generatePlaceholder(array $element) { $element = [ '#lazy_builder' => [get_class() . '::renderMessages', [$element['#display']]], '#create_placeholder' => TRUE, ]; // Directly create a placeholder as we need this to be placeholdered // regardless if this is a POST or GET request. // @todo remove this when https://www.drupal.org/node/2367555 lands. return \Drupal::service('render_placeholder_generator')->createPlaceholder($element); }
Please login to continue.