Skip to content

Kirby 4.1.2

$pages->offset()

Returns a new object starting from the given offset

$pages->offset(int $offset): Kirby\Cms\Pages

Parameters

Name Type Default Description
$offset * int The index to start from

Return type

Kirby\Cms\Pages

This method does not modify the existing $pages object but returns a new object with the changes applied. Learn more →

Parent class

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

Example

<ul>
  <?php foreach($page->children()->offset(10) as $subpage): ?>
  <li>
    <a href="<?= $subpage->url() ?>">
      <?= html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>