Adds page number parameter to current Url and returns formatted url

@param string $url         Url to append page numbers
@param int    $currentPage Current page number
@param int    $languageId  Requested language

@return string
768572
protected function _addPageNrParam($url, $currentPage, $languageId = null)
    {
        if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && ($category = $this->getActiveCategory())) {
            if ($currentPage) {
                // only if page number > 0
                $url = $category->getBaseSeoLink($languageId, $currentPage);
            }
        } else {
            $url = parent::_addPageNrParam($url, $currentPage, $languageId);
        }

        return $url;
    }
940276
public function getPagesMenu($menuName, $lang = NULL)
    {
//         $currentUser = $this->securityContext->getToken()->getUser();
//         if ($currentUser != 'anon.')
//         {
//             $roles = $currentUser->getRoles();
//         }
//         else
//         {
//             $roles = array();
//         }
        $pages = $this->doctrine->getRepository('FulgurioLightCMSBundle:PageMenu')->findPagesOfMenu($menuName, $lang);
        $availablePages = array();
        foreach ($pages as &$page)
        {
//             $pageAccesses = $page->getAccess();
//             if (empty($pageAccesses))
//             {
//                 $page->setAllowedChildren($this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->getAllowedChildren($roles, $page));
                $availablePages[] = $page;
//             }
//             else if (is_object($currentUser))
//             {
//                 foreach ($pageAccesses as $pageAccess)
//                 {
//                     if ($currentUser->hasRole($pageAccess))
//                     {
//                         $page->setAllowedChildren($this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->getAllowedChildren($roles, $page));
//                         $availablePages[] = $page;
//                         break;
//                     }
//                 }
//             }
        }
        return $availablePages;
    }
776672
public function searchForPaginatedContent($searchText, $currentPage, $languages)
    {
        // Generating query
        $query = new Query();
        $query->query = new Criterion\FullText($searchText);
        $query->filter = new Criterion\LogicalAnd(
            array(
                new Criterion\Visibility(Criterion\Visibility::VISIBLE),
                new Criterion\LanguageCode($languages, true),
            )
        );

        // Initialize pagination.
        $pager = new Pagerfanta(
            new ContentSearchAdapter($query, $this->searchService)
        );
        $pager->setMaxPerPage($this->searchListLimit);
        $pager->setCurrentPage($currentPage);

        return $pager;
    }
981017
protected function calculateLinks($currentPage, $numberOfPages)
    {
        $baseUrl = $this->getBaseUrl();
        $prev = ($currentPage > 1) ? $currentPage - 1 : null;
        $next = ($currentPage < $numberOfPages) ? $currentPage + 1 : null;

        $separator = ($this->paginationLink) ? '/' : '?page=';

        return [
            'current' => $baseUrl.$separator.$currentPage,
            'prev' => ($prev) ? $baseUrl.$separator.$prev : null,
            'next' => ($next) ? $baseUrl.$separator.$next : null,
            'last' => ($numberOfPages > 0) ? $baseUrl.$separator.$numberOfPages : null,
        ];
    }
1138464
public function getPageByUid(int $uid, int $languageUid = null) {
    return $this->getPage($uid, $languageUid);
  }
566821
static function getLangByUrl($url = null)
    {
        if ($url === null) {
            return null;
        } else {
            $language = Lang::find()->where('url = :url', [':url' => $url])->one();
            if ( $language === null ) {
                return null;
            }else{
                return $language;
            }
        }
    }
1351260
protected function setCurrentPage($currentPage, $pageName)
    {
        $currentPage = $currentPage ?: static::resolveCurrentPage($pageName);

        return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1;
    }
1168379
public function actionEdit($templateId, $languageId = null)
    {
        $editForm = new EditForm([
            'templateId' => $templateId,
            'languageId' => $languageId
        ]);
        return $this->renderForm($editForm, 'edit');
    }
46575
public function getDefaultUrl($language = null)
    {
        foreach ($this->urls as $url) {
            if ($url->isDefault()) {
                return $url;
            }
        }

        return null;
    }
1349696
public function url(string $language = null): ?string
    {
        if ($this->route === null) {
            return null;
        }

        if ($language === null) {
            return urlMl(array_get($this->route, 'path'), app()->getLocale());
        }

        $route = array_first($this->routes, function ($route) use ($language) {
            return $route['language_code'] === $language && $route['is_active'] === true;
        });

        return urlMl(array_get($route, 'path'), $language);
    }
806777
public function getPage(int $uid, int $languageUid = null) {
    $page   = null;
    $record = Page::find($uid);

    if ($record) {
      $record = $record->getAttributes();

      if (is_array($record) && !empty($record) && in_array($record['doktype'], self::PAGE_DOKTYPES)) {
        $page                  = $record;
        $l18nCfg               = isset($page['l18n_cfg']) ? $page['l18n_cfg'] : 0;
        $hideIfDefaultLanguage = (boolean) GeneralUtility::hideIfDefaultLanguage($l18nCfg);
        $hideIfNotTranslated   = (boolean) GeneralUtility::hideIfNotTranslated($l18nCfg);
        $languageUid           = isset($languageUid) ? $languageUid : $this->languageService->getLanguageUid();

        if ($hideIfDefaultLanguage) {
          $page['hidden'] = 1;
        }

        if ($languageUid > 0) {
          $constraints     = [['pid', '=', $uid], ['sys_language_uid', '=', $languageUid], ['deleted', '=', 0]];
          $languageOverlay = LanguageOverlay::where($constraints)->first();

          if ($languageOverlay) {
            $languageOverlayAttributes = [];
            $attributes                = $languageOverlay->getAttributes();

            foreach (self::PAGE_LANGUAGE_OVERLAY_ATTRIBUTES as $attribute) {
              if (is_string($attributes[$attribute]) && empty($attributes[$attribute])) {
                continue;
              }

              $languageOverlayAttributes[$attribute] = $attributes[$attribute];
            }

            $page = array_merge($page, $languageOverlayAttributes);

            if ($this->extensionService->runningInFallbackMode() && !$hideIfDefaultLanguage && !$hideIfNotTranslated) {
              $page['hidden'] = 0;
            }
          }
        }
      }
    }

    return $page;
  }
135935
public function currentPage()
    {
        $currentRoute = $this->router->getCurrentRoute();

        if (! $currentRoute) {
            return 1;
        }

        $query = $currentRoute->parameter('pageQuery');

        return (int) str_replace($this->pageKeyword.'/', '', $query) ?: 1;
    }
1281845
public function addPage(
        Result $result,
        int $page
    ): string {
        $urlParameters = $this->generateQueryUrlParameters($result);
        $urlParameters['page'] = $page;

        return $this->createUrlByUrlParameters(
            $result,
            $urlParameters
        )['route'];
    }
1243353
public function getBaseLink($languageId = null)
    {
        if (!isset($languageId)) {
            $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        }

        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) {
            if ($displayObj = $this->_getSubject($languageId)) {
                $url = $displayObj->getLink($languageId);
            } else {
                $encoder = \OxidEsales\Eshop\Core\Registry::getSeoEncoder();
                $constructedUrl = $config->getShopHomeUrl($languageId) . $this->_getSeoRequestParams();
                $url = $encoder->getStaticUrl($constructedUrl, $languageId);
            }
        }

        if (!$url) {
            $constructedUrl = $config->getShopCurrentURL($languageId) . $this->_getRequestParams();
            $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($constructedUrl, true, null, $languageId);
        }

        return $url;
    }
126897
public static function getCurrentPage($url = '')
    {
        if (static::$currentPage !== false) {
            return static::$currentPage;
        }
        /** @var static $model */
        $model = static::find()->where([
            'url' => preg_replace('/[\/]{2,}/', '/', '/' . $url . '/'),
            'visible' => static::VISIBLE_YES
        ])->orderBy('id DESC')->one();
        if (!$model) {
            return static::$currentPage = null;
        }
        if ($model->layout) {
            Yii::$app->controller->layout = $model->layout;
        }
        Yii::$app->view->title = $model->page_title;
        Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $model->page_description]);
        Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $model->page_keywords]);
        return static::$currentPage = $model;
    }
601704
private function setCurrentPageUrl()
    {
        $controller = Url::segment(1);
        $method = '';
        $method = (Url::segment(2) == '') ? 'index' : Url::segment(2);

        $this->currentPageUrl = Url::getBase().$controller.'/'.$method;
    }
1067212
public function setPager ($total_count, $current_page, $url, $limit = PagerUtility::DISP_PER_PAGE, $options = []) {
 		$current_page	= $current_page ?: 1;
 		$options		= [
			'in_list_position'	=> $options['in_list_position']	?? 3,
			'max_link_disp'		=> $options['max_link_disp'] ?? 5,
 		];
 		$this->pager = PagerUtility::CreatePagerData($total_count, $current_page, $limit, $options);
 		$this->pager['enable']	= $total_count > $limit;
 		$this->pager['url']		= $url;

 		return $this->pager;
 	}