You are here

protected function JsonFeedSerializer::getNextPage in JSON Feed 8

Get the URL of the next page.

1 call to JsonFeedSerializer::getNextPage()
JsonFeedSerializer::render in src/Plugin/views/style/JsonFeedSerializer.php
Render the display in this style.

File

src/Plugin/views/style/JsonFeedSerializer.php, line 275

Class

JsonFeedSerializer
Default style plugin to render a JSON feed.

Namespace

Drupal\json_feed\Plugin\views\style

Code

protected function getNextPage() {

  // Check for pager and pager settings.
  $pager = $this->displayHandler
    ->getPlugin('pager');
  if (empty($pager) || !$pager
    ->hasMoreRecords()) {
    return NULL;
  }
  $pager_manager = \Drupal::service('pager.manager');
  $options = [
    'query' => $pager_manager
      ->getUpdatedParameters([], 0, $pager
      ->getCurrentPage() + 1),
  ];
  return Url::fromRoute('<current>', [], $options)
    ->setAbsolute()
    ->toString();
}