Skip to content

Kirby 5.1.1

$collection->has()

Checks if the given object or id is in the collection

$collection->has(string|TValue $key): bool

Parameters

Name Type Default
$keyrequired stringorTValue no default value

Return type

bool

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

Parent class

Kirby\Cms\Collection