src/Controller/CrudController.php
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;
    }
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;
    }
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