You are here

public function FieldCollectionItemController::pageTitle in Field collection 8

Same name and namespace in other branches
  1. 8.3 src/Controller/FieldCollectionItemController.php \Drupal\field_collection\Controller\FieldCollectionItemController::pageTitle()

The _title_callback for the field_collection_item.view route.

Parameters

FieldCollectionItem $field_collection_item: The current field_collection_item.

Return value

string The page title.

1 string reference to 'FieldCollectionItemController::pageTitle'
field_collection.routing.yml in ./field_collection.routing.yml
field_collection.routing.yml

File

src/Controller/FieldCollectionItemController.php, line 92

Class

FieldCollectionItemController
Returns responses for Field collection item routes.

Namespace

Drupal\field_collection\Controller

Code

public function pageTitle(FieldCollectionItem $field_collection_item) {
  return \Drupal::service('entity.repository')
    ->getTranslationFromContext($field_collection_item)
    ->label();
}