Skip to content

Kirby 4.5.0

$files->count()

Counts all elements

$files->count(): int

Return type

int

Parent class

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

Example

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

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

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

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