$pages->slice($offset = null, $limit = null)

Returns a sliced version of the collection defined by offset and limit

  • $offset (int)
    The offset number
  • $limit (int)
    The number of items to be returned
  • return ($pages)

Example

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