entity_page_label

entity_page_label(EntityInterface $entity, $langcode = NULL)

Returns the label of an entity.

$entity->label($langcode);

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

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

Deprecated

as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the entity's label() method to get the label of the entity:

See also

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

File

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

Code

function entity_page_label(EntityInterface $entity, $langcode = NULL) {
  return $entity->label($langcode);
}
doc_Drupal
2016-10-29 09:09:16
Comments
Leave a Comment

Please login to continue.