Url::toRenderArray

public Url::toRenderArray()

Returns the route information for a render array.

Return value

array An associative array suitable for a render array.

File

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

Class

Url
Defines an object that holds information about a URL.

Namespace

Drupal\Core

Code

public function toRenderArray() {
  $render_array = [
    '#url' => $this,
    '#options' => $this->getOptions(),
  ];
  if (!$this->unrouted) {
    $render_array['#access_callback'] = [get_class(), 'renderAccess'];
  }
  return $render_array;
}
doc_Drupal
2016-10-29 09:51:44
Comments
Leave a Comment

Please login to continue.