Skip to content

Kirby 6.0.0

$items->update()

Updates an object in the collection

$items->update(string|Item $key, Item|null $object = null): Items

Parameters

Name Type Default Description
$keyrequired stringorKirby\Cms\Item no default value Key or object to update
$object Kirby\Cms\Itemornull null New object for the key

Return type

Kirby\Cms\Items

This method modifies the existing $items object it is applied to and returns it again.

Parent class

Kirby\Cms\Items inherited from Kirby\Cms\Collection