Skip to content

Kirby 3.9.8

collection()

Returns the result of a collection by name

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

Parameters

Name Type Default
$name * string
$options array [ ]

Return type

Kirby\Toolkit\Collection|null

Examples

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

See also: Defining collections