Generate a custom URL to a tag.

@param string $routeName
@param array  $customAttributes

@return string
188794
public function href($routeName = 'tag.single', $customAttributes = [])
    {
        $params = ['tagSlug'=>$this->slug];
        if($customAttributes) {
            $params = array_merge($customAttributes, $params);
        }
        return route($routeName, $params);
    }
490210
public static function customButton($title, $url, $attributes = array())
    {
        // configuration
        $config = self::config();

        // no configuration file
        if (!$config) {
            return null;
        }

        $attributes = Helpers::addClass($attributes, "clef");

        return '<a href="https://clef.io/iframes/qr?app_id='.$config['app_id'].'&amp;redirect_url='.$url.'" '.\HTML::attributes($attributes).'>'.$title.'</a>';
    }
526236
protected function generateUrl($route, $parameters = array(), $absolute = false)
    {
        return $this->getService('Router')->generate($route, $parameters, $absolute);
    }
198518
public static function generate(RouteCollection $routeCollection, $routeName)
    {
        $flag = false;
        $index = 1;
        while ($flag === false) {
            if ($routeCollection->get($routeName)) {
                $routeName = $routeName.'_'.$index++;
            } else {
                $flag = true;
            }
        }

        return $routeName;
    }
557963
public function url($routeName, $data = []) {
        $data2 = [];
        $i = 1;

        // Map key (p1, p2, p3....)
        foreach ($data as $value) {
            $data2["p" . $i++] = $value;
        }

        return $this->slim->urlFor("_louisCRUD_" . $routeName, $data2);
    }
540857
final public function urlFor($routeName, array $params = array())
    {
        if (null === $this->router) {
            return '';
        }

        return $this->router->urlFor($routeName, $params);
    }
1371366
public function createLink($name, array $defaultRouteParams = array(), array $extra = array())
    {
        $options = $this->getLinkOptions($name);
        $factory = $this->createFactory($defaultRouteParams, $extra);

        return $factory->createItem($name, $options);
    }
425876
public function getLinkAttributes($extraAttributes = null) {
    $attributes = $this->getRawLinkAttributes($extraAttributes);
    return Template::raw(is_null($attributes)
      ? ''
      : Html::renderTagAttributes($attributes)
    );
  }
1320603
protected function createRoute(
        $domain,
        CustomUrlBehavior $document,
        Localization $locale,
        $persistedLocale,
        $routesPath
    ) {
        $path = sprintf('%s/%s', $routesPath, $domain);
        $routeDocument = $this->findOrCreateRoute($path, $persistedLocale, $document, $domain);
        $routeDocument->setTargetDocument($document);
        $routeDocument->setLocale($locale->getLocale());
        $routeDocument->setHistory(false);

        $this->documentManager->persist(
            $routeDocument,
            $persistedLocale,
            [
                'path' => $path,
                'auto_create' => true,
            ]
        );
        $this->documentManager->publish($routeDocument, $persistedLocale);

        return $routeDocument;
    }
728602
public function render($customAttributes = null)
    {
        if ($customAttributes != null && count($customAttributes) > 0) {
            $attributes = array_merge($this->attributes, $customAttributes);
        } else {
            $attributes = $this->attributes;

            if (count(MenuHelper::getConfig()->getAnchorElementClasses()) > 0) {
                if (!array_key_exists('class', $attributes)) {
                    $attributes['class'] = '';
                }

                foreach (MenuHelper::getConfig()->getAnchorElementClasses() as $listElementClass) {
                    $attributes['class'] .= ' ' . $listElementClass;
                }
            }
        }

        if (empty($this->name)) {
            $content = Html::link('#', $this->title, $attributes);
        } else {
            $content = Html::linkRoute($this->name, $this->title, $this->parameters, $attributes);
        }

        return $content;
    }
374061
public function getRouteByPath($path, RequestContext $context, array &$routeAttributes = [])
    {
        $path = $this->normalizePath($path);
        $potentialRoutes = $this->filterRouteCollectionForPath($this->getRoutes(), $path);
        $matcher = new UrlMatcher($potentialRoutes, $context);
        $routeAttributes = $matcher->match($path);

        return $potentialRoutes->get($routeAttributes['_route']);
    }
365362
protected function _attainRouteFromArray($routeName, array $routeValuable)
    {
        if (! (isset($routeValuable['route']) || isset($routeValuable['routes'])) )
            throw new \InvalidArgumentException(
                'Options must define requested route as options key on "route" or "routes".'
            );

        $route = null;
        if ( isset($routeValuable['route']) ) {
            $routeClass = (string) $routeValuable['route'];
            if (!class_exists($routeClass)) {
                // prefixed with namesapce looking for default routes
                $routeClass = ltrim($routeClass, '\\');
                $routeClass = __NAMESPACE__.'\\Route\\'.$routeClass;
            }

            if (!class_exists($routeClass))
                throw new \InvalidArgumentException(sprintf(
                    'Router (%s) not found.'
                    , $routeValuable['route']
                ));

            /** @var iRoute|iRouterStack $route */
            $route = new $routeClass($routeName);

            $options  = (isset($routeValuable['options']))   ? $routeValuable['options']  : null;
            $params   = (isset($routeValuable['params']))    ? $routeValuable['params']   : null;

            ($options === null) ?: $route->with($route::parseWith($options));
            ($params === null)  ?: $route->params()->import($params);
        }

        $routes = (isset($routeValuable['routes'])) ? $routeValuable['routes'] : null;
        if ($routes && !$route instanceof iRouterStack) {
            // it has child routes
            if ($route === null)
                $route = new RouterStack($routeName);
            else
                $route = new RouteStackChainWrapper($route);

            $build = new self();
            $build->setRoutes($routes);
            $build->build($route);
        }

        return $route;
    }
769156
public function getPaginatorHtml(Pagination $pagination, $routeName = null, $routeParameters = array())
    {
        return $this->templating->render(
            'TadckaPaginatorBundle::pagination.html.twig',
            array(
                'pagination' => $pagination,
                'route_name' => $routeName,
                'route_parameters' => $routeParameters,
                'pagination_class' => $this->paginationClass,
                'pagination_links_class' => $this->paginationLinksClass,
                'pagination_link_class' => $this->paginationLinkClass,
                'max_near_pages' => $this->maxNearPages,
            )
        );
    }
1019336
public function editUrl()
    {
        try {
            return route('admin::edit-attribute', [$this->attribute_group_id, $this->id]);
        } catch (InvalidArgumentException $e) {
            Log::error($e->getMessage());
        }
    }
11636
public function linkRoute($routeName, $title = null, $parameters = [], $attributes = [], $additionalRouteNames = [], $isVisible = true)
    {
        return new LinkRoute($routeName, $title, $parameters, $attributes, $additionalRouteNames, $isVisible);
    }
1170085
private function parseAttributeName(Input $definition): string
    {
        $maxLength = self::MAX_ATTRIBUTE_NAME_LENGTH;

        $name = $definition->takeAllAlphaNumUntil(":}");

        if (empty($name)) {
            throw InvalidRoute::emptyAttributeName($definition);
        }

        if (strlen($name) > $maxLength) {
            throw InvalidRoute::longAttributeName($definition, $maxLength);
        }

        return $name;
    }
1273418
protected function getCustomUrl(array $urlParameters = array())
    {
        $urlParameters = $this->addRequestVariablesToUrlParameters($urlParameters);

        if ($this->customUrl && count($urlParameters) > 0)
        {
            $params = http_build_query($urlParameters);

            if ('' != parse_url($this->customUrl, PHP_URL_QUERY))
            {
                // existing query string, append
                return $this->customUrl.'&'.$params;
            }

            return $this->customUrl.'?'.$params;
        }

        return $this->customUrl;
    }