Skip to content

Kirby 4.4.1

$page->hasChildren()

Checks if the model has any published children

$page->hasChildren(): bool

Return type

bool

Parent class

Kirby\Cms\Page

Example

<?php
echo $page->hasChildren(); //will echo 1 if true, nothing if false

if($page->hasChildren()) {
  $children = $page->children();
}
?>