$page->hasDocuments()
Checks if the Files collection has any document files
$page->hasDocuments(): bool
Return type
bool
Parent class
Example
<?php
echo $page->hasDocuments(); //returns the number of documents in the folder
if($page->hasDocuments()) {
$documents = $page->documents();
}
?>
What is a document file?
Kirby considers the following file types as document:
- text
- mdown
- md
- markdown
- doc
- docx
- dotx
- word
- xl
- xls
- xlsx
- xltx
- ppt
- pptx
- csv
- rtf
- rtx