$files->add()
Adds a single file or an entire second collection to the current collection
$files->add(Kirby\Cms\Files|Kirby\Cms\File|string $object): Kirby\Cms\Files
Parameters
| Name | Type | Default |
|---|---|---|
| $objectrequired | Kirby\Cms\Files<TFile>orKirby\Cms\Fileorstring |
no default value |
Return type
This method modifies the existing $files object it is applied to and returns it again.
Exceptions
| Type | Description |
|---|---|
Kirby\Exception\InvalidArgumentException |
When no File or Files object or an ID of an existing file is passed |