Skip to content

Kirby 5.1.1

$block->indexOf()

Returns the position / index in the collection

$block->indexOf(Kirby\Cms\Blocks|null $collection = null): int|false

Parameters

Name Type Default
$collection Kirby\Cms\Blocksornull null

Return types

intorfalse

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

Parent class

Kirby\Cms\Block inherited from Kirby\Cms\Item