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
Examples
<?php
$customCollection = collection('projects');
dump($customCollection);
See also: Defining collections