$page->hasImages()
Checks if the Files collection has any images
$page->hasImages(): bool
Return type
bool
Parent class
What is an image file?
Kirby considers the following file types as images:
- ai
- avif
- bmp
- gif
- eps
- ico
- j2k
- jp2
- jpeg
- jpg
- jpe
- png
- ps
- psd
- svg
- tif
- tiff
- webp
Examples
<?php
echo $page->hasImages(); // will echo 1 if true, nothing if false
if ($page->hasImages()) {
$images = $page->images();
}
?>