You are here

public function FileManagementViewController::getFileUsageTitle in File Management 8

Returns the file usage page title.

Parameters

int $fid: The file id of the file to load.

Return value

string The page title.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException Thrown if the entity type doesn't exist.

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException Thrown if the storage handler couldn't be loaded.

1 string reference to 'FileManagementViewController::getFileUsageTitle'
file_management_view.routing.yml in modules/file_management_view/file_management_view.routing.yml
modules/file_management_view/file_management_view.routing.yml

File

modules/file_management_view/src/Controller/FileManagementViewController.php, line 64

Class

FileManagementViewController
Provides route responses for the File Management Views module.

Namespace

Drupal\file_management_view\Controller

Code

public function getFileUsageTitle($fid) {
  $file = \Drupal::entityTypeManager()
    ->getStorage('file')
    ->load($fid);
  return $this
    ->t('File usage information for @file', [
    '@file' => $file
      ->getFilename(),
  ]);
}