$pagination->nextPage()

Returns the next page number

  • return (integer)

Example

<?php

$subpages   = $page->children()->paginate(10);
$pagination = $subpages->pagination();

?>

<!-- foreach loop with subpages -->

<?php if($pagination->hasPrevPage()): ?>
<a href="<?php echo $pagination->prevPageUrl() ?>">
  prev (<?php echo $pagination->prevPage() ?>)
</a>
<?php endif ?>

<?php if($pagination->hasNextPage()): ?>
<a href="<?php echo $pagination->nextPageUrl() ?>">
  next (<?php echo $pagination->nextPage() ?>)
</a>
<?php endif ?>