You are here

public function Asset::isDocument in Mini site 8

Check if asset is a document and can be served as a page.

Overrides AssetInterface::isDocument

2 calls to Asset::isDocument()
Asset::getHeaders in src/Asset.php
Array of headers for current asset.
Asset::render in src/Asset.php
Render asset.

File

src/Asset.php, line 496

Class

Asset
Class Asset.

Namespace

Drupal\minisite

Code

public function isDocument() {
  try {
    FileValidator::validateFileExtension($this->urlBag
      ->getUri(), [
      'html',
      'htm',
    ]);
    return TRUE;
  } catch (InvalidExtensionValidatorException $exception) {

    // Do nothing as this is expected.
  }
  return FALSE;
}