You are here

public function FlippingBook::buildFlippingBookUrl in Flipping Book 8

Build Flipping Book URL.

Parameters

\Drupal\flipping_book\Entity\FlippingBook $flippingBook: A Flipping Book entity.

Return value

string The complete Flipping Book URL used for visualization.

Overrides FlippingBookInterface::buildFlippingBookUrl

File

src/FlippingBook.php, line 113

Class

FlippingBook
Class FlippingBook.

Namespace

Drupal\flipping_book

Code

public function buildFlippingBookUrl(FlippingBookEntity $flippingBook) {
  $location = $this
    ->extractUploadLocation($flippingBook);
  $dir = $flippingBook
    ->getDirectory();
  $uri = file_create_url("{$location}/{$dir}/index.html");
  return Url::fromUri($uri);
}