You are here

public function PhotosUserAlbumsController::title in Album Photos 8.4

Photos page title.

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

File

src/Controller/PhotosUserAlbumsController.php, line 102

Class

PhotosUserAlbumsController
Display user albums.

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 albums", [
      '@name' => $account
        ->getDisplayName(),
    ]);
  }
  else {
    return $this
      ->t('My Albums');
  }
}