Skip to content

Kirby 5.1.2

$assets->indexOf()

Correct position detection for objects. The method will automatically detect objects or ids and then search accordingly.

$assets->indexOf(string|Kirby\Plugin\Asset $needle): int|false

Parameters

Name Type Default
$needlerequired stringorKirby\Plugin\Asset no default value

Return types

intorfalse

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

Parent class

Kirby\Plugin\Assets inherited from Kirby\Cms\Collection