Skip to content

Kirby 3.6.6

$pages->intersects()

Checks if there is an intersection between the given collection and this collection

$pages->intersects(\Kirby\Toolkit\Collection $other): bool

Parameters

Name Type Default
$other * Kirby\Toolkit\Collection

Return type

bool

Parent class

Kirby\Cms\Pages inherited from Kirby\Toolkit\Collection

Example

$articles1 = $page->children()->filterBy('tags', 'water', ',');
$articles2 = $page->children()->filterBy('tags', 'nature', ',');

if ($articles1->intersects($articles2) {
    // do something
};