$page->hasImages()

Checks if there are image files (jpg, png, gif, etc.) in the page directory

  • return (integer)

Example

<?php
echo $page->hasImages(); //returns the number of images in the folder

if($page->hasImages()) {
  $images = $page->images();
}
?>

What is an image file?

Kirby considers the following file types as images:

  • jpeg
  • jpg
  • jpe
  • gif
  • png
  • svg
  • ico
  • tif
  • tiff
  • bmp
  • psd
  • ai
  • eps
  • ps

Is something missing or incorrect? Edit this page on Github…