function ViewUI::toUrl
Same name and namespace in other branches
- 9 core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::toUrl()
- 8.9.x core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::toUrl()
- 11.x core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::toUrl()
Gets the URL object for the entity.
The entity must have an id already. Content entities usually get their IDs by saving them.
URI templates might be set in the links array in an annotation, for example:
links = {
"canonical" = "/node/{node}",
"edit-form" = "/node/{node}/edit",
"version-history" = "/node/{node}/revisions"
}
or specified in a callback function set like:
uri_callback = "comment_uri",
If the path is not set in the links array, the uri_callback function is used for setting the path. If this does not exist and the link relationship type is canonical, the path is set using the default template: entity/entityType/id.
Parameters
string $rel: The link relationship type, for example: canonical or edit-form. If none is provided, canonical is assumed, or edit-form if no canonical link exists.
array $options: See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options.
Return value
\Drupal\Core\Url The URL object.
Overrides EntityInterface::toUrl
1 call to ViewUI::toUrl()
- ViewUI::standardCancel in core/
modules/ views_ui/ src/ ViewUI.php - Submit handler for cancel button.
File
-
core/
modules/ views_ui/ src/ ViewUI.php, line 1013
Class
- ViewUI
- Stores UI related temporary settings.
Namespace
Drupal\views_uiCode
public function toUrl($rel = NULL, array $options = []) {
return $this->storage
->toUrl($rel, $options);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.