function entity_page_label

Returns the label of an entity.

This is a wrapper for Drupal\Core\Entity\EntityInterface::label(). This function should only be used as a callback, e.g. for menu title callbacks.

Parameters

Drupal\Core\Entity\EntityInterface $entity: The entity for which to generate the label.

$langcode: (optional) The language code of the language that should be used for getting the label. If set to NULL, the entity's default language is used.

Return value

The label of the entity, or NULL if there is no label defined.

See also

Drupal\Core\Entity\EntityInterface::label()

9 string references to 'entity_page_label'
aggregator_menu in drupal/core/modules/aggregator/aggregator.module
Implements hook_menu().
contact_menu in drupal/core/modules/contact/contact.module
Implements hook_menu().
custom_block_menu in drupal/core/modules/block/custom_block/custom_block.module
Implements hook_menu().
custom_block_test_menu in drupal/core/modules/block/custom_block/tests/modules/custom_block_test/custom_block_test.module
Implements hook_menu().
forum_menu in drupal/core/modules/forum/forum.module
Implements hook_menu().

... See full list

File

drupal/core/includes/entity.inc, line 383
Entity API for handling entities like nodes or users.

Code

function entity_page_label(EntityInterface $entity, $langcode = NULL) {
  return $entity
    ->label($langcode);
}