function EntityTypeInterface::getLinkTemplates
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityTypeInterface.php \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates()
- 8.9.x core/lib/Drupal/Core/Entity/EntityTypeInterface.php \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates()
- 10 core/lib/Drupal/Core/Entity/EntityTypeInterface.php \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates()
Gets the link templates using the URI template syntax.
Links are an array of standard link relations to the URI template that should be used for them. Where possible, link relationships should use established IANA relationships rather than custom relationships.
Entities which can be viewed should define "canonical", which is the pattern for URIs to that entity including REST. Entities that will be user-editable via an HTML page should define an "edit-form" relationship.
By default, the following placeholders are supported:
- [entityType]: The entity type itself will also be a valid token for the ID of the entity. For instance, a placeholder of {node} used on the Node class.
- [bundleEntityType]: The bundle machine name itself. For instance, a placeholder of {node_type} used on the Node class.
Specific entity types may also expand upon this list by overriding the EntityBase::urlRouteParameters() method.
http://www.iana.org/assignments/link-relations/link-relations.xml http://tools.ietf.org/html/rfc6570
Return value
array An array of link templates using the URI template syntax.
1 method overrides EntityTypeInterface::getLinkTemplates()
- EntityType::getLinkTemplates in core/
lib/ Drupal/ Core/ Entity/ EntityType.php - Gets the link templates using the URI template syntax.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityTypeInterface.php, line 440
Class
- EntityTypeInterface
- Provides an interface for an entity type and its metadata.
Namespace
Drupal\Core\EntityCode
public function getLinkTemplates();
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.