You are here

public function PhotosImageViewController::title in Album Photos 6.0.x

Same name and namespace in other branches
  1. 8.5 src/Controller/PhotosImageViewController.php \Drupal\photos\Controller\PhotosImageViewController::title()

The _title_callback for the page that renders a single photos image.

Parameters

\Drupal\Core\Entity\EntityInterface $photos_image: The current photos_image.

Return value

string The page title.

File

src/Controller/PhotosImageViewController.php, line 270

Class

PhotosImageViewController
Image view controller.

Namespace

Drupal\photos\Controller

Code

public function title(EntityInterface $photos_image) {
  $title = '';
  if ($this->entityRepository) {
    $title = $this->entityRepository
      ->getTranslationFromContext($photos_image)
      ->label();
  }
  return $title;
}