Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Mini.php

function Mini::postExecute

Overrides PagerPluginBase::postExecute

File

core/modules/views/src/Plugin/views/pager/Mini.php, line 76

Class

Mini
The plugin to handle mini pager.

Namespace

Drupal\views\Plugin\views\pager

Code

public function postExecute(&$result) {
    // Only modify the result if we didn't do a total row count.
    if (!$this->view->get_total_rows) {
        $this->total_items = $this->getCurrentPage() * $this->getItemsPerPage() + count($result);
        // query() checks if we need a next link by setting limit 1 record past
        // this page If we got the extra record we need to remove it before we
        // render the result.
        if ($this->getItemsPerPage() > 0 && count($result) > $this->getItemsPerPage()) {
            array_pop($result);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal