Reference

Guide

$page->hasListedChildren()

Checks if the page has any listed children

$page->hasListedChildren(): bool

Return type

bool

Example

echo $page->hasListedChildren(); //will echo 1 if true, nothing if false

if($page->hasListedChildren()) {
  $children = $page->children()->listed();
}

Source code

kirby/src/Cms/HasChildren.php#L193