Element::isVisibleElement

public static Element::isVisibleElement($element)

Determines if an element is visible.

Parameters

array $element: The element to check for visibility.

Return value

bool TRUE if the element is visible, otherwise FALSE.

File

core/lib/Drupal/Core/Render/Element.php, line 155

Class

Element
Provides helper methods for Drupal render elements.

Namespace

Drupal\Core\Render

Code

public static function isVisibleElement($element) {
  return (!isset($element['#type']) || !in_array($element['#type'], ['value', 'hidden', 'token']))
    && (!isset($element['#access'])
    || (($element['#access'] instanceof AccessResultInterface && $element['#access']->isAllowed()) || ($element['#access'] === TRUE)));
}
doc_Drupal
2016-10-29 09:04:00
Comments
Leave a Comment

Please login to continue.