Skip to content

Kirby 4.5.0

$page->hasFiles()

Checks if the Files collection has any files

$page->hasFiles(): bool

Return type

bool

Parent class

Kirby\Cms\Page

Example

<?php
echo $page->hasFiles(); //will echo 1 if true, nothing if false

if($page->hasFiles()) {
  $files = $page->files()
}
?>