Url::renderAccess

public static Url::renderAccess(array $element)

Checks a Url render element against applicable access check services.

Parameters

array $element: A render element as returned from \Drupal\Core\Url::toRenderArray().

Return value

bool Returns TRUE if the current user has access to the url, otherwise FALSE.

File

core/lib/Drupal/Core/Url.php, line 805

Class

Url
Defines an object that holds information about a URL.

Namespace

Drupal\Core

Code

public static function renderAccess(array $element) {
  return $element['#url']->access();
}
doc_Drupal
2016-10-29 09:51:42
Comments
Leave a Comment

Please login to continue.