1 entity.module entity_uri($entity_type, $entity)

Returns the URI elements of an entity.

Parameters

$entity_type: The entity type; e.g. 'node' or 'user'.

$entity: The entity for which to generate a path.

Return value

An array containing the 'path' and 'options' keys used to build the URI of: the entity, and matching the signature of url(). NULL if the entity has no URI of its own.

File

core/modules/entity/entity.module, line 755
Entity API for handling entities like nodes or users.

Code

function entity_uri($entity_type, $entity) {
  return $entity->uri();
}