$page->next([$sort, $direction])

Returns the next sibling

  • $sort (string)
    An optional sort field for the siblings
  • $direction (string)
    An optional sort direction
  • return ($page)

Example

<?php if($next = $page->next()): ?>
<a href="<?= $next->url() ?>">next page</a>
<?php endif ?>

Using sort field

<?php if($next = $page->next('date', 'desc')): ?>
<a href="<?= $next->url() ?>">next page</a>
<?php endif ?>

Is something missing or incorrect? Edit this page on Github…