Skip to content

Kirby 6.0.0

$blocks->update()

Updates an object in the collection

$blocks->update(string|Block $key, Block|null $object = null): Blocks

Parameters

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

Return type

Kirby\Cms\Blocks

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

Parent class

Kirby\Cms\Blocks inherited from Kirby\Cms\Collection