Opens web page using route name and parameters.

``` php
<?php
$I->amOnRoute('posts.create');
$I->amOnRoute('posts.show', array('id' => 34));
?>
```

@param $routeName
@param array $params
181891
public function amOnRoute($routeName, array $params = [])
    {
        $router = $this->grabService('router');
        if (!$router->getRouteCollection()->get($routeName)) {
            $this->fail(sprintf('Route with name "%s" does not exists.', $routeName));
        }
        $url = $router->generate($routeName, $params);
        $this->amOnPage($url);
    }
285416
protected function getUrl($route, $params = array())
    {
        $urlHelper = $this->getView()->plugin('url');

        if ('#' === $route[0]) {
            return $route;
        }

        return $urlHelper($route, $params, $this->getRouteOptions());
    }
80662
public function render($controllerName, $actionName, $params = null) {
        if (empty($this->controllerViewPath)) {
            $this->setControllerViewPath($controllerName);
        }
        parent::render($this->controllerViewPath, $actionName, $params);
    }
1047167
public static function linkRoute($name, $params = array(), $url = null)
    {
        //starting defining url and qs
        $url = ($url != '') ? $url : $_SERVER["REQUEST_URI"];
        $url_arr = explode('?', $url);
        $url = $url_arr[0];
        $qs = (isset($url_arr[1])) ? $url_arr[1] : '';
        if (!is_array($params)) $params = (array) $params;
        
        //is a stric-uri?
        if (isset(self::$routes[$name][0]) and self::$routes[$name][0]=== '^') {
            $is_strict = true;
            $route = self::$routes[$name];
            //in this case remove conditional patterns
            $url = self::parsePattern($route, true);

            //we remove also conditional atoms
            $url = preg_replace('#\(.*\)\?#', '', $route);

            $url = ltrim($url, '^');
            $url = rtrim($url, '$');
            if (preg_match_all('#\(.*\)#U',$url, $matches)) {
                foreach ($params as $key=>$param) {
                    $url = str_replace($matches[0][$key],$param, $url);
                }
            }
            
            if (self::$qs[$name]) {
                $qs = preg_replace('#(&?)'.self::$qs[$name].'#', '', $qs);
            }
            
        //non strict route
        } else {
            $is_strict = false;
            
            //If required we remove other routes (from segments and qs)
            if (count(self::$remove[$name])) {

                foreach (self::$remove[$name] as $route) {

                    if (self::$routes[$route]) {
                        $url = preg_replace('#(\/?)'.self::$routes[$route].'#', '', $url);
                    }
                    if (self::$qs[$route]) {
                        $qs = preg_replace('#(&?)'.self::$qs[$route].'#', '', $qs);
                    }

                }
            }

            //if this route works with uri
            //I check for all params to build the append segment with given params,
            //then I strip current rule and append new one.
            if (self::$routes[$name]) {
                $append =  self::$routes[$name];
                if (preg_match_all('#\(.*\)#U',$append, $matches)) {
                    foreach ($params as $key=>$param) {
                        $append = str_replace($matches[0][$key],$param, $append);
                    }
                }
                $url = preg_replace('#(\/?)'.self::$routes[$name].'#', '', $url);
                $url = $url."/".$append;
                $url = str_replace('//','/',$url);

            }
            
        }

        
        //if this route works on query string
        //I check for all params to buid and "append" or "replace" query string with given params.
        $append = '';
        if (self::$qs[$name]) {
            $append =  self::$qs[$name];
            if (preg_match_all('#\(.*\)#U',$append, $matches)) {
                foreach ($params as $key=>$param) {
                    $append = str_replace($matches[0][$key],$param, $append);
                }
            }
            $qs = preg_replace('#(&?)'.self::$qs[$name].'#', '', $qs);
            $qs = str_replace('&&','&',$qs);
            $qs = rtrim($qs, '&');
            $qs =  $qs .'&'.$append;
            $qs = ltrim($qs, '&');

        }
        if ($is_strict == true) $qs = $append;
        if ($qs != '') $qs = '?'.$qs;
        if ($url == '') $url = '/';
        return $url.$qs;
    }
468395
public function execute($routeName, array $parameters = array(), ServerRequest $request = null)
    {
        // expect it as route name
        if(!is_string($routeName))
            throw new Exception\InvalidArgumentException('Argument 1 must be [string]');

        $route = $this->map->findRoute($routeName);

        if(!$route)
            throw new RouteNotFoundException('Route [' . $routeName . '] does not exist.');

        return $this->run($this->map->getFactory()->createFinding($route, $parameters, $request));
    }
436406
public function generateUrl(string $routeName, array $routeParameters = []): ?string
    {
        foreach ($this->routes as $route) {
            if ($route->getCallback() instanceof self) {
                $url = ($route->getCallback())->generateUrl($routeName, $routeParameters);
                if ($url !== null) {
                    return $url;
                }
            } else {
                if ($route->getName() === $routeName) {
                    return $route->generateUrl($routeParameters);
                }
            }
        }

        return null;
    }
399940
public function url($id, array $params = array())
    {
        $route = $this->getRoute($id);

        if (!isset($route)) {
            throw new \RuntimeException('Named route not found for id: '.$id);
        }

        $search = array();
        foreach ($params as $key => $value) {
            // try to match ':{key}' fragments and replace it with value
            $search[] = '#:'.preg_quote($key, '#').'\+?(?!\w)#';
        }

        $pattern = preg_replace($search, $params, $route[3]['pattern']);

        // Remove remnants of unpopulated, trailing optional pattern segments, escaped special characters
        return preg_replace('#\(/?:.+\)|\(|\)|\\\\#', '', $pattern);
    }
929922
public function addRouteParameters(array $params)
    {
        $this->parameters = array_merge($this->parameters,$params);
        $this->rawParameters = array_merge($this->rawParameters, $params);

        $this->routeParameters = $params;
    }
1051576
public function getRoute(string $routeKey, array $params = []): string
    {
        $this->checkRouteIsDefined($routeKey);

        return route(
            $this->getAttribute('routes')[$routeKey]['alias'],
            array_merge($this->getAttribute('routes')[$routeKey]['parameters'], $params)
        );
    }
585799
public function match($url, $to = null, array $params = array())
    {
        if (!$params && is_array($to)) {
            $params = $to;
            $to = null;
        }
        $this->createAndAddRoute($url, $to, $params);
    }
513162
public function url($name, $params = array()) {
		if (!isset($this->namedRoutes[$name])) {
			throw new RouterException("No route matches this name : $name");
		}

		return $this->namedRoutes[$name]->getUrl($params);
	}
364516
public static function a($text = '', $route = '', Array $params = [], $options = [])
    {
        $optionsHtml = '';
        array_walk($options, function ($value, $key) use (&$optionsHtml) {
            $optionsHtml .= $key . '="' . $value . '" ';
        });
        return '<a href="' . self::url($route, $params) . '" ' . $optionsHtml . ' >' . $text . '</a>';
    }
1131822
public function url($name, $params = array())
	{
		if ( ! array_key_exists($name, $this->routes))
		{
			throw new \UnexpectedValueException("A route with the name {$name} was not found");
		}

		$route = $this->routes[$name];
		return $route->url($params);
	}
1168524
public function toRoute($name, array $params = [])
    {
        $url = $this->getUrl()->fromRoute($name, $params);

        return $this->toUrl($url);
    }
902037
public function createUrl( $route, $params = [ ], $absolute = FALSE )
    {
        return $this[ 'request' ]->createUrl( $route, $params, $absolute );
    }
533307
public function seeCurrentRouteIs($routeName)
    {
        if (!$this->di->has('url')) {
            $this->fail('Unable to resolve "url" service.');
        }

        /** @var Url $url */
        $url = $this->di->getShared('url');
        $this->seeCurrentUrlEquals($url->get(['for' => $routeName], null, true));
    }
818528
public function fromRoute($name, array $params = [])
    {
        $router = $this->getRouter();
        $route  = $router->get($name);

        return $route->assemble($params);
    }