function callback_entity_info_uri

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 4893

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.