$pages->has()
Checks if the given object or id is in the collection
$pages->has(string|Kirby\Cms\Page $key): bool
Parameters
| Name | Type | Default |
|---|---|---|
| $keyrequired | stringorKirby\Cms\Page |
no default value |
Return type
bool
This method modifies the existing $pages object it is applied to and returns it again.
Parent class
Kirby\Cms\Pages
inherited from Kirby\Cms\Collection
<?php if (page('projects')->children()->has('projects/project-a')): ?>
There exists a subpage with the uid `some-page`
<?php endif ?>