You are here

public function PhotosImageController::getTitle in Album Photos 8.4

Set page title.

1 string reference to 'PhotosImageController::getTitle'
photos.routing.yml in ./photos.routing.yml
photos.routing.yml

File

src/Controller/PhotosImageController.php, line 86

Class

PhotosImageController
Image view controller.

Namespace

Drupal\photos\Controller

Code

public function getTitle() {

  // Get node object.
  $fid = $this->routeMatch
    ->getParameter('file');
  $title = $this->connection
    ->query("SELECT title FROM {photos_image} WHERE fid = :fid", [
    ':fid' => $fid,
  ])
    ->fetchField();
  return $title;
}