You are here

public function FileEntity::isPage in File Entity (fieldable files) 8.2

Checks whether the current page is the full page view of the file.

Return value

bool TRUE if current page is the full page view of the file, or FALSE otherwise.

File

src/Entity/FileEntity.php, line 423

Class

FileEntity
Replace for the core file entity class.

Namespace

Drupal\file_entity\Entity

Code

public function isPage() {
  $page_file = \Drupal::routeMatch()
    ->getParameter('file');
  return !empty($page_file) && $page_file
    ->id() == $this
    ->id();
}