Skip to content

Kirby 6.0.0

collection()

Returns the result of a collection by name

collection(string $name, array $options = []): Collection|null

Parameters

Name Type Default
$namerequired string no default value
$options array []

Return types

Kirby\Toolkit\Collectionornull

Examples

<?php
$customCollection = collection('projects');
dump($customCollection);