function Url::renderAccess
Same name in other branches
- 9 core/lib/Drupal/Core/Url.php \Drupal\Core\Url::renderAccess()
- 8.9.x core/lib/Drupal/Core/Url.php \Drupal\Core\Url::renderAccess()
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.
Deprecated
in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement.
See also
https://www.drupal.org/node/3342977
File
-
core/
lib/ Drupal/ Core/ Url.php, line 851
Class
- Url
- Defines an object that holds information about a URL.
Namespace
Drupal\CoreCode
public static function renderAccess(array $element) {
@trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3342977', E_USER_DEPRECATED);
return $element['#url']->access();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.