Generates an URL for a page slug.

@param array       $parameters    An array of parameters
@param bool|string $referenceType The type of reference to be generated (one of the constants)

@throws \RuntimeException

@return string
18047
protected function generateFromPageSlug(array $parameters = [], $referenceType = self::ABSOLUTE_PATH)
    {
        if (!isset($parameters['path'])) {
            throw new \RuntimeException('Please provide a `path` parameters');
        }

        $url = $parameters['path'];
        unset($parameters['path']);

        return $this->decorateUrl($url, $parameters, $referenceType);
    }
618549
private function getPaginationRelativeUrl(Request $request, array $parameters = array())
    {
        $relativeUrl = new RequestHelper($request, $this->router);

        return $relativeUrl->getRelativeUrl($parameters);
    }
246764
protected function createSignature($requestType)
    {
        if (empty($this->getPostData())) {
            throw new RuntimeException('Need setup post data');
        }

        $canonical = $this->getCanonicalRequest($requestType, $this->getPostData());
        $stringToSign = $this->getStringToSign($canonical);
        return $this->getSignature($stringToSign);
    }
400486
public function getBasePath($name, $referenceType = RouterInterface::ABSOLUTE_PATH)
    {
        $baseLink = null;
        $matchingRouteName = null;
        $matchingRoutePath = null;

        $baseRoute = $this->router->getRouteCollection()->get($name);
        if ($baseRoute === null) {
            return [
                null,
                null
            ];
        }
        $matchingRouteName = $this->findMatchingPaths($baseRoute);

        $item = $this->menuRepository->findByViewRoute($matchingRouteName);
        if ($item !== null) {
            $matchingRoutePath = $this->router->generate($matchingRouteName, [], $referenceType, false);

            $app = \JFactory::getApplication();
            $joomlaRouter = $app::getRouter();

            if ($item !== null) {
                if ($joomlaRouter->getMode() == \JROUTER_MODE_SEF) {
                    $baseLink = \JRoute::_('index.php?Itemid=' . $item->getId());
                } else {
                    $baseLink = \JRoute::_($item->getLink() . '&path=');
                }
            }
        }

        return [
            $baseLink,
            $matchingRoutePath
        ];
    }
624213
protected function getRedirectCode($pageType)
    {
        return isset($this->pageTypeToRedirectMapping[$pageType])
            ? $this->pageTypeToRedirectMapping[$pageType]
            : $pageType;
    }
787679
public function getArticlesIndexPermalink(array $parameters = [], $absolute = 1)
    {
        return $this->getContainer()->get('router')->generate($this->getArticlesIndexRoute(), $this->getArticlesIndexRouteParameters($parameters), $absolute);
    }
301834
public function generateAdminPath(
        $admin,
        $actionCode,
        array $parameters = [],
        $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH
    ): string {
        $admin = $this->getAdmin($admin);
        $action = $admin->getAction($actionCode);

        $missingParams = $this->computeMissingRouteParameters($action->getRoute(), $parameters);
        foreach ($missingParams as $missingParam) {
            if ($this->router->getContext()->hasParameter($missingParam)) {
                $parameters[$missingParam] = $this->router->getContext()->getParameter($missingParam);
            }
        }

        return $this->router->generate($action->getRouteName(), $parameters, $referenceType);
    }
1082809
public function generateEntities(array $parameters)
    {
        $relPath = '/Entity/Pages/';
        $sourceDir = $this->skeletonDir.$relPath;
        $targetDir = $this->bundle->getPath().$relPath;

        $this->renderSingleFile($sourceDir, $targetDir, 'HomePage.php', $parameters);
        $this->renderSingleFile($sourceDir, $targetDir, 'ContentPage.php', $parameters);
        $this->renderSingleFile($sourceDir, $targetDir, 'BehatTestPage.php', $parameters);

        if ($this->demosite) {
            $this->renderSingleFile($sourceDir, $targetDir, 'FormPage.php', $parameters);
            $this->renderSingleFile($sourceDir, $targetDir, 'SearchPage.php', $parameters);
        }

        if ($this->demosite) {
            $relPath = '/Entity/PageParts/';
            $sourceDir = $this->skeletonDir.$relPath;
            $targetDir = $this->bundle->getPath().$relPath;

            $this->renderSingleFile($sourceDir, $targetDir, 'PageBannerPagePart.php', $parameters);
            $this->renderSingleFile($sourceDir, $targetDir, 'ServicePagePart.php', $parameters);
            $this->renderSingleFile($sourceDir, $targetDir, 'UspPagePart.php', $parameters);
            $this->renderSingleFile($sourceDir, $targetDir, 'BikesListPagePart.php', $parameters);
        }

        if ($this->demosite) {
            $relPath = '/Entity/';
            $sourceDir = $this->skeletonDir.$relPath;
            $targetDir = $this->bundle->getPath().$relPath;

            $this->renderSingleFile($sourceDir, $targetDir, 'Bike.php', $parameters);
            $this->renderSingleFile($sourceDir, $targetDir, 'UspItem.php', $parameters);
        }

        $this->assistant->writeLine('Generating entities : <info>OK</info>');
    }
886923
private function getReferenceType($type)
    {
        switch ($type) {
            case 'absolute':
                return UrlGeneratorInterface::ABSOLUTE_PATH;
            case 'url':
                return UrlGeneratorInterface::ABSOLUTE_URL;
            case 'relative':
                return UrlGeneratorInterface::RELATIVE_PATH;
            case 'network':
                return UrlGeneratorInterface::NETWORK_PATH;
            default:
                return UrlGeneratorInterface::ABSOLUTE_PATH;
        }
    }
1013650
public function redirectToAction(
        Action $action,
        array $parameters = [],
        $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH,
        $status = 302
    ): RedirectResponse {
        $url = $this->adminRouter->generateAdminPath(
            $action->getAdmin(),
            $action->getCode(),
            $parameters,
            $referenceType
        );

        return new RedirectResponse($url, $status);
    }
703132
protected function installUrl(string $slug, string $type): string
    {
        $qualifier           = $slug; // Same as slug.
        $identifier          = $type; // Same as type.
        $nonce_action_prefix = 'install'; // Same for both.

        $args = [
            'action'        => 'install-'.$type,
            '___action_via' => $this->App->Config->©brand['©slug'],
            $identifier     => $qualifier, // Dependency.
        ];
        $admin_url = $this->Wp->is_multisite ? 'network_admin_url' : 'self_admin_url';

        $url = $admin_url('/update.php');
        $url = $this->c::addUrlQueryArgs($args, $url);
        $url = $this->s::addUrlNonce($url, $nonce_action_prefix.'-'.$type.'_'.$qualifier);

        return $url;
    }
1073283
public function generateUrl( array $arguments = null )
    {
        // ezpRestPrefixFilterInterface::getScheme() ==> '/v'
        $apiPrefix = ezpRestPrefixFilterInterface::getApiPrefix() . '/';
        $apiProviderName = ezpRestPrefixFilterInterface::getApiProviderName();

        return $apiPrefix . ( !$apiProviderName ? ''  : $apiProviderName . '/' ) . 'v' . $this->version . '/' . str_replace( $apiPrefix, '', $this->route->generateUrl( $arguments ) );
    }
353345
public function generateUrl($name, array $parameters = array())
    {
        return $this->container->get('router.url_generator')->generate($name, $parameters, true);
    }
67458
public function getFaqIndexPermalink(array $parameters = [], $absolute = 1)
    {
        return $this->getContainer()->get('router')->generate($this->getFaqIndexRoute(), $this->getFaqIndexRouteParameters($parameters), $absolute);
    }
557481
public function currentPageUrl($parameters = [], $routePersistence = true)
    {
        if (!$currentFile = $this->page->getFileName()) {
            return null;
        }

        return $this->pageUrl($currentFile, $parameters, $routePersistence);
    }
468607
public function invoke($type, $parameters = null)
    {
        $class = $this->getClass($type);
        $name  = $this->normalizeType($type);

        $params = func_get_args();
        array_shift($params);

        $reflector = new \ReflectionClass($class);
        $instance  = $reflector->newInstanceArgs($params);

        if (empty($params)) {
            parent::__set($name, $instance);
        }

        return (clone $instance);
    }
844623
protected function generateStandardUrl(array $urlParameters = array(), $absolute = false)
    {
        if (parent::isCurrent())
        {
            return '#'.$this->getAnchor();
        }
        
        return parent::generateStandardUrl($urlParameters, $absolute);
    }