Skip to content

Kirby 5.0.4

$page->hasFiles()

Checks if the Files collection has any files

$page->hasFiles(): bool

Return type

bool

This method modifies the existing $page object it is applied to and returns it again.

Parent class

Kirby\Cms\Page

Examples

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

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