$pages->limit($limit)

Returns the collection with a limited amount of pages

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

Example

<h2>Latest subpages</h2>
<ul>
  <?php foreach($page->children()->limit(3) as $subpage): ?>
  <li>
    <a href="<?php echo $subpage->url() ?>">
      <?php echo html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>