code: protected function buildUrl($iTotal, $iPage, $iPageOffset)
      {
          $aParams = [
              'page' => $iPage + $iPageOffset,
          ];
  
          if ($aParams['page'] <= 0) {
              return null;
          } elseif ($aParams['page'] === 1) {
              unset($aParams['page']);
          }
  
          $iTotalPages = ceil($iTotal / static::CONFIG_PER_PAGE);
          if (!empty($aParams['page']) && $aParams['page'] > $iTotalPages) {
              return null;
          }
  
          $sUrl = site_url() . uri_string();
  
          if (!empty($aParams)) {
              $sUrl .= '?' . http_build_query($aParams);
          }
  
          return $sUrl;
      }
docs: Builds pagination URL
  
  @param integer $iTotal      The total number of items
  @param integer $iPage       The current page number
  @param integer $iPageOffset The offset to the page number
  
  @return null|string