public static Element::isEmpty(array $elements)
Indicates whether the given element is empty.
An element that only has #cache set is considered empty, because it will render to the empty string.
Parameters
array $elements: The element.
Return value
bool Whether the given element is empty.
File
- core/lib/Drupal/Core/Render/Element.php, line 198
Class
- Element
- Provides helper methods for Drupal render elements.
Namespace
Drupal\Core\Render
Code
1 2 3 | public static function isEmpty( array $elements ) { return empty ( $elements ) || ( count ( $elements ) === 1 && array_keys ( $elements ) === [ '#cache' ]); } |
Please login to continue.