Generate pagination route
@param type $route
@param type $extraParams
@return type
776649
public function getPaginationPath($route, $page, $extraParams = array())
    {
        $params = array(
            $this->getActionParameterName() => $this->getPageActionParameterName(),
            $this->getDatagridParameterName() => $this->getName(),
            $this->getPageParameterName() => $page,
        );
        return $this->container->get('router')->generate($route, array_merge($params, $extraParams));
    }
36705
protected function generateLoc($hostWithScheme, $route, $parameters = [])
    {
        if (null === $this->router) {
            throw new \RuntimeException('UrlGenerator interface is missing');
        }

        list($scheme, $host) = explode('://', $hostWithScheme);

        $this->router
            ->getContext()
            ->setHost($host)
            ->setScheme($scheme);

        return $this->router->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_URL);
    }
664295
public function route($route, $queries = [], $type = MainRouter::TYPE_PATH)
    {
        return $this->build($route, $queries, $type);
    }
692112
public function setRoute(string $route = null, array $params = []): ButtonInterface
    {
        if ($this->isVisibility()) {
            if ($route === null) {
                $url = '#';
            } else {
                $url = '#';
                if (app('router')->has($route)) {
                    $url = route($route, $params);
                } else {
                    $this->setVisible(false);
                }
            }
            $this->setUrl($url);
        }

        return $this;
    }
1344254
public function iAmOnPage($route)
    {
        $parameters = [];
        $requestBody = $this->dataContext->getRequestBody();
        if($requestBody != null){
            $parameters = $requestBody;
        }
        $this->getSession()->visit($this->generatePageUrl($route,$parameters));
        if($this->isOpenBrowser()){
            $this->getSession()->wait(2000);
        }
    }
94999
protected function populateContent(Route $route, Request $request)
    {
        $content = $route->getContent();
        $name    = $content;

        if ($route->isList()) {
            $name .= 's';
            $value = $this->repository->getContents($content, $route->getIndexBy(), $route->getOrder());

            if ($route->isPaginated()) {
                $paginator = new Paginator($value, $route->getPerPage());
                $value     = $paginator->get($request->attributes->get('page'));
                $request->attributes->set('paginator', $paginator);
            }
        } else {
            $value = $this->repository->getContent($content, $request->attributes->get($content));
        }

        $request->attributes->set($name, $value);
    }
456932
public function protect( Page $page, $protections, array $extraParams = [] ) {
		if ( !is_array( $protections ) || empty( $protections ) ) {
			throw new InvalidArgumentException(
				'$protections must be an array with keys and values'
			);
		}

		$params = [
			'pageid' => $page->getId(),
			'token' => $this->api->getToken( 'protect' ),
		];
		$protectionsString = '';
		foreach ( $protections as $action => $value ) {
			if ( !is_string( $action ) || !is_string( $value ) ) {
				throw new InvalidArgumentException(
					'All keys and elements of $protections must be strings'
				);
			}
			$protectionsString = $action . '=' . $value . '|';
		}
		$params['protections'] = rtrim( $protectionsString, '|' );

		$this->api->postRequest(
			new SimpleRequest( 'protect', array_merge( $extraParams, $params ) )
		);

		return true;
	}
228068
public function createRoute($route)
    {
        return new Route($this->adapter, $this->container, $this->container['request'], $route);
    }
389972
public static function url($route = '', Array $params = [])
    {
        $dir = dirname($_SERVER['PHP_SELF']);
        $dir = $dir == DIRECTORY_SEPARATOR ? '':$dir;
        $scheme = isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'] ? 'https':'http';
        $baseUrl = $scheme.'://'.$_SERVER['HTTP_HOST'].$dir.'/?r='.$route;
        return empty($params) ? $baseUrl : $baseUrl . '&' . http_build_query($params);
    }
1486
public function pagination($items, $page = 1, $perPage = 25, $path = '', array $componentOptions = [])
    {
        $items = $items instanceof Collection ? $items : Collection::make($items);

        $paginator = (new LengthAwarePaginator($items, $items->count(), (int) $perPage, (int) $page))
            ->withPath($path);

        return $paginator->render('bootstrap::render.pagination', $componentOptions);
    }
1092833
public function showAction($id, $extra) {
        $entity = $this->container->get("layout.read_handler")->get($id);
        $delete_form = $this->container->get("layout.form_handler")->createDeleteForm($id);


//        $route_collection = $this->container->get('router')->getRouteCollection()->all();
//        echo '<pre>';
//        if(is_object($route_collection))
//            print_r(get_class_methods($route_collection));
//            print_r($route_collection);
//            
//            echo '</pre>';

        $layout = str_replace(":show.html.twig", ":display.html.twig", $this->container->get("request")->get('_layout'));

        $params = array(
            "entity" => $entity
            , "extra" => $extra
        );

        return new Response($this->container->get('templating')->render($layout, $params));
    }
724972
private function _setParamsToRoute($route, $params)
    {
        foreach ($params as $key => $value)
        {
            $route = preg_replace('/\{' . $key . '\}/', $value, $route);
        }

        return $route;
    }
1093869
public function paginate(
        PagerService $pager,
        $route,
        array $parameters = [],
        $template = 'ONGRPagerBundle:Pager:paginate.html.twig'
    ) {
        return $this->environment->render(
            $template,
            ['pager' => $pager, 'route' => $route, 'parameters' => $parameters]
        );
    }
43048
protected function pagePaginatedRoute(
        $route,
        $pageNumber,
        $pageSize,
        Fields $fields,
        Sorting $sorting,
        Included $included,
        $filters
    ) {
        $fieldKeys = [];
        if (false === $fields->isEmpty()) {
            $fieldKeys = $fields->get();
            foreach ($fieldKeys as &$v) {
                $v = implode(',', $v);
            }
        }

        $queryParams = urldecode(
            http_build_query(
                array_filter([
                        'page' => array_filter(
                            [
                                'number' => $pageNumber,
                                'size' => $pageSize,
                            ]
                        ),
                        'fields' => $fieldKeys,
                        'filter' => $filters,
                        'sort' => $sorting->get(),
                        'include' => $included->get(),
                    ])
            )
        );

        $expression = ($route[strlen($route) - 1] === '?' || $route[strlen($route) - 1] === '&') ? '%s%s' : '%s?%s';

        return sprintf($expression, $route, $queryParams);
    }
192755
public function setRoute(DataSourceViewInterface $dataSource, $route, array $additional_parameters = [])
    {
        $this->routes[$dataSource->getName()] = $route;
        $this->additional_parameters[$dataSource->getName()] = $additional_parameters;
    }
915318
public function uriFor($route, array $params = [], array $query = [])
    {
        if (!$route) {
            return '';
        }

        return $this->router->relativePathFor($route, $params, $query);
    }
442206
protected function pagePaginationLinks(
        $route,
        $pageNumber,
        $pageSize,
        $totalPages,
        Fields $fields,
        Sorting $sorting,
        Included $included,
        $filters
    ) {
        $next = $pageNumber + 1;
        $previous = $pageNumber - 1;
        $last = ($pageSize == 0) ? 0 : ceil($totalPages / $pageSize);

        $links = array_filter(
            [
                'self' => $pageNumber,
                'first' => 1,
                'next' => ($next <= $last) ? $next : null,
                'previous' => ($previous >= 1) ? $previous : null,
                'last' => $last,
            ]
        );

        foreach ($links as &$numberedLink) {
            $numberedLink = $this->pagePaginatedRoute(
                $route,
                $numberedLink,
                $pageSize,
                $fields,
                $sorting,
                $included,
                $filters
            );
        }

        return $links;
    }