You are here

public function PhotosUserImagesController::title in Album Photos 8.4

Photos page title.

1 string reference to 'PhotosUserImagesController::title'
photos.routing.yml in ./photos.routing.yml
photos.routing.yml

File

src/Controller/PhotosUserImagesController.php, line 141

Class

PhotosUserImagesController
Content controller for user images.

Namespace

Drupal\photos\Controller

Code

public function title() {

  // Generate title.
  $user = $this
    ->currentUser();
  $uid = $this->routeMatch
    ->getParameter('user');
  if ($uid != $user
    ->id()) {
    $account = $this->entityTypeManager
      ->getStorage('user')
      ->load($uid);
    return $this
      ->t("@name's images", [
      '@name' => $account
        ->getDisplayName(),
    ]);
  }
  else {
    return $this
      ->t('My Images');
  }
}