$page->hasVideos()
Checks if the Files collection has any videos
$page->hasVideos(): bool
Return type
bool
This method modifies the existing $page
object it is applied to and returns it again.
Parent class
What is a video file?
Kirby considers the following file types as video:
- avi
- flv
- m4v
- mov
- movie
- mpe
- mpg
- mp4
- ogg
- ogv
- swf
- webm
Examples
<?php
echo $page->hasVideos(); // will echo 1 if true, nothing if false
if ($page->hasImages()) {
$videos = $page->videos();
}
?>