Skip to content

Kirby 5.0.4

$files->count()

Counts all elements

$files->count(): int

Return type

int

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

Parent class

Kirby\Cms\Files inherited from Kirby\Toolkit\Iterator

Examples

echo $page->files()->count();

echo $page->images()->count();

echo $page->documents()->count();

echo $page->files()->filterBy('extension', 'pdf')->count();