You are here

public function StaticDownloadController::downloadAccess in Tome 8

Custom access callback to determine if there's anything to download.

Return value

\Drupal\Core\Access\AccessResult The access result.

1 string reference to 'StaticDownloadController::downloadAccess'
tome_static.routing.yml in modules/tome_static/tome_static.routing.yml
modules/tome_static/tome_static.routing.yml

File

modules/tome_static/src/Controller/StaticDownloadController.php, line 115

Class

StaticDownloadController
Contains routes related to Tome Static.

Namespace

Drupal\tome_static\Controller

Code

public function downloadAccess() {
  return AccessResult::allowedIf(file_exists($this->static
    ->getStaticDirectory()) && (new \FilesystemIterator($this->static
    ->getStaticDirectory()))
    ->valid());
}