Returns a new html anchor.

@param string, $routeName
@param string|null $title
@param array $parameters
@param array $attributes
@param array $additionalRouteNames
@param bool $isVisible
@return LinkRoute
11636
public function linkRoute($routeName, $title = null, $parameters = [], $attributes = [], $additionalRouteNames = [], $isVisible = true)
    {
        return new LinkRoute($routeName, $title, $parameters, $attributes, $additionalRouteNames, $isVisible);
    }
225823
public function amOnRoute($routeName, array $params = [])
    {
        if (!$this->di->has('url')) {
            $this->fail('Unable to resolve "url" service.');
        }

        /** @var Url $url */
        $url = $this->di->getShared('url');

        $urlParams = ['for' => $routeName];

        if ($params) {
            $urlParams += $params;
        }

        $this->amOnPage($url->get($urlParams, null, true));
    }
1368238
public function route($name, $parameters = [], $absolute = true)
    {
        if (! is_null($route = $this->routes->getByName($name))) {
            return $this->toRoute($route, $parameters, $absolute);
        }

        throw new InvalidArgumentException("Route [{$name}] not defined.");
    }
1240881
public static function linkUrl($url, $title = null, $attributes = array())
    {
        $title = ($title) ? $title : $url;
        $compiled = '';
        if (count($attributes)) {
            $compiled = '';
            foreach ($attributes as $key => $val) {
                $compiled .= ' ' . $key . '="' .  htmlspecialchars((string) $val, ENT_QUOTES, "UTF-8", true) . '"';
            }
        }
        return '<a href="'.$url.'"'.$compiled.'>'.$title.'</a>';
    }
1346365
public static function substituteAttributes(array $attributes, $uri)
    {
        foreach ($attributes as $key => $value) {
            if ($value instanceof RouteBindable)
                $value = $value->getWildcardValue();

            $uri = str_replace(['{'.$key.'?}', '{'.$key.'}'], $value, $uri);
        }

        // delete empty optional arguments that are not in the $attributes array
        return preg_replace('/\/{[^)]+\?}/', '', $uri);
    }
1124165
function addItem($as, $key, $attrs = []) {
        if (!Route::isEnable($as)) {
            return $this;
        }
        if (is_array($as)) {
            $text = Arr::get($as, 'title');
            $icon = Arr::get($as, 'icon');
            $url  = Arr::get($as, 'url', '#');
            $as   = Arr::get($as,
                'as');
        }
        else {
            $text = Route::get_title($as);
            $icon = Route::get_icon($as);
            $url  = Route::get_url($as);
        }
        if ($icon) {
            $text = \HtmlI::setTitle($text)->addClass($icon) . ' &nbsp;' . \HtmlSpan::setContent($text);
        }
        $this->map->add($key,
            $as,
            $text,
            $url,
            $attrs);
        return $this;
    }
459849
public function link($url, $title = null, $attributes = [], $secure = null, $escape = true)
    {
        $url = $this->url->to($url, [], $secure);

        if (is_null($title) || $title === false) {
            $title = $url;
        }

        if ($escape) {
            $title = $this->entities($title);
        }

        return $this->toHtmlString('<a href="' . $this->entities($url) . '"' . $this->attributes($attributes) . '>' . $title . '</a>');
    }
1077501
public function linkRoute($route, $name, $parameters=array(), $position="BL", $attributes=array())
    {
        return $this->link(route($route, $parameters), $name, $position, $attributes);
    }
577699
public function linkAction($action, $name, $parameters=array(), $position="BL", $attributes=array())
    {
        return $this->link(action($action, $parameters), $name, $position, $attributes);
    }
1345069
protected function addRoute($routeName, $details)
    {
        if ( FALSE !== strstr($details[ 'path' ], '/{/') ) {
            $details[ 'path' ] = str_replace('/{/', '{/', $details[ 'path' ]);
        }
        if ( !isset($details[ 'methods' ]) ) {
            $details[ 'methods' ] = 'GET,POST,PUT,PATCH,DELETE,HEAD';
        }

        if ( FALSE !== strstr($details[ 'methods' ], 'GET') ) {
            if ( FALSE === strstr($details[ 'methods' ], 'HEAD') ) {
                $details[ 'methods' ] .= ',HEAD';
            }
        }

        $values = [
            'namespace' => isset($details[ 'namespace' ]) ? $details[ 'namespace' ] : NULL,
        ];
        $values = $values + (isset($details[ 'defaults' ]) ? $details[ 'defaults' ] : []);

        $spec = [
            'tokens' => isset($details[ 'tokens' ]) ? $details[ 'tokens' ] : [],
            'values' => $values,
            'method' => explode(',', $details[ 'methods' ]),
        ];

//        $wildcard = FALSE;
//        if ( $details[ 'path' ][ strlen($details[ 'path' ]) - 1 ] == '*' ) {
//            $wildcard          = TRUE;
//            $details[ 'path' ] = str_replace('*', '', $details[ 'path' ]);
//        }

        $route = new RouteFactory('Arhitect\Router\Adapter\RouteAdapter');
        $route = $route->newInstance(
            $details[ 'path' ],
            $routeName,
            $spec
        );
//        if ( $wildcard ) {
//            $route->setWildcard('/\*/');
//        }

        return $route;
    }
108582
static function Url(PageUrl $pageUrl, array $additionalParameters = array())
    {
        $list = new PageParamListProvider($pageUrl);
        $params = $list->ToArray();
        foreach ($additionalParameters as $key => $value) {
            $params[$key] = $value;
        }
        return self::PageUrl($pageUrl->GetPage(), $params, $pageUrl->GetFragment());
    }
382707
public function addRoute($method, $route, $action, $extra = [])
	{
		$name = (isset($extra["name"])) ? $extra["name"] : $route;

		if (isset($this->rawRoutes[$name])) {
			$Route = $this->rawRoutes[$name];
		} else {
			$Route              = clone $this->Route;
			$Route->route       = $this->baseUri.$route;
			$Route->name 		= $name;
		}

		$Route->addExtra($extra);
		$methods = [];
		if ("ANY" === $method) {
			$methods["GET"]  = $action;
			$methods["POST"] =& $methods["GET"];
			$methods["PUT"]  =& $methods["GET"];

			$Route->methods = $methods;
			$Route->action = $action;

			$this->rawRoutes[$name] = $Route;
		} else {

			$arrayedMethod = (array) $method;
			$count = count($arrayedMethod);

			for ($i = 0; $i < $count; $i++) {
				if (!isset($this->allowedMethods[$arrayedMethod[$i]])) {
					throw new InvalidMethodException("Method: " . $arrayedMethod[$i] . " is not valid");
				}
				$method = $arrayedMethod[$i];
				$Route->action = $action;
				$Route->method = $method;
				$Route->name = $name;
				$this->rawRoutes[$name] = $Route;
			}
		}


		return $Route;
	}
1077799
public static function path($name, $parameters = [], $absolute = false) {
		return self::getRouteByName ( $name, $parameters, $absolute );
	}
279542
public function link($url, $title, $attributes = [])
    {
        $attributes['href'] = $url;
        $tag = new Tag('a', $attributes);
        $tag->setText($title);
        return $tag;
    }
1049904
public function routeModel( $name, $model, $parameters = [], $absolute = true )
	{
		if ( !$model instanceof RoutableModel )
			throw new UrlGenerationException( "The model [" . get_class( $model ) . "] must implement the RoutableModel interface." );

		if ( !is_null( $route = $this->routes->getByName( $name ) ) )
		{
			$appendedUrl = "";

			if ( is_array( $p = $model->appendRoute( $name, $parameters, $appendedUrl ) ) )
				$parameters = array_merge( $parameters, $p );

			return $this->toRoute( $route, $parameters, $absolute ) . $appendedUrl;
		}

		throw new RouteNotFoundException( "Route [{$name}] not found." );
	}
101820
public function victoireMenuLink($parameters, $label, $linkAttr = [], $listAttr = [])
    {
        if ($this->request && ($this->request->getRequestUri() == $this->victoireLinkUrl($parameters, false))) {
            $this->addAttr('class', 'active', $listAttr);
        }

        return '<li '.$this->formatAttributes($listAttr).'>'.$this->victoireLink($parameters, $label, $linkAttr, false, '#top').'</li>';
    }
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,
            )
        );
    }