# collection()

Returns the result of a collection by name

****

- Read more: <https://getkirby.com/docs/guide/templates/collections

---

Examples:

```php
<?php
$customCollection = collection('projects');
dump($customCollection);
```>
- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/helpers.php#L60>

****

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

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$name` (required) | `string` | – | – |
| `$options` | `array` | `[ ]` | – |

## Return types

`Kirby\Toolkit\Collection` or `null`