function callback_entity_info_uri

callback_entity_info_uri($entity)

Return the URI for an entity.

Callback for hook_entity_info().

Parameters

$entity: The entity to return the URI for.

Return value

An associative array with the following elements:

  • 'path': The URL path for the entity.
  • 'options': (optional) An array of options for the url() function.

The actual entity URI can be constructed by passing these elements to url().

Related topics

File

modules/system/system.api.php, line 4850
Hooks provided by Drupal core and the System module.

Code

function callback_entity_info_uri($entity) {
  return array(
    'path' => 'node/' . $entity->nid,
  );
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/callback_entity_info_uri/7.x