public function StatusMessages::getInfo

public StatusMessages::getInfo()

Generate the placeholder in a #pre_render callback, because the hash salt needs to be accessed, which may not yet be available when this is called.

Overrides ElementInterface::getInfo

File

core/lib/Drupal/Core/Render/Element/StatusMessages.php, line 27

Class

StatusMessages
Provides a messages element.

Namespace

Drupal\Core\Render\Element

Code

public function getInfo() {
  return [
    // May have a value of 'status' or 'error' when only displaying messages
    // of that specific type.
    '#display' => NULL,
    '#pre_render' => [
      get_class() . '::generatePlaceholder',
    ],
  ];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!StatusMessages.php/function/StatusMessages::getInfo/8.1.x