You are here

function photos_image_is_page in Album Photos 6.0.x

Same name and namespace in other branches
  1. 8.5 photos.module \photos_image_is_page()

Returns whether the current page is the photos_image page.

Parameters

\Drupal\photos\PhotosImageInterface $photos_image: A photos_image entity.

Return value

bool True if it is the photos_image page.

1 call to photos_image_is_page()
template_preprocess_photos_image in ./photos.module
Prepares variables for photos image templates.

File

./photos.module, line 1407
Implementation of photos.module.

Code

function photos_image_is_page(PhotosImageInterface $photos_image) {
  if (\Drupal::routeMatch()
    ->getRouteName() == 'entity.photos_image.canonical' && ($page_photos_image_id = \Drupal::routeMatch()
    ->getRawParameter('photos_image'))) {
    return $page_photos_image_id == $photos_image
      ->id();
  }
  return FALSE;
}