src/Router/UrlGenerator/SimpleUrlGenerator.php
public function generate($name, array $parameters = array(), $absolute = false)
    {
        if (!$this->initialized) {
            $this->initialize();
        }

        $path = $this->routes[$name];
        if (is_array($path)) {
            $params = $path['params'];
            $path = $path['path'];

            foreach ($params as $param) {
                if (!isset($parameters[$param])) {
                    throw new \RuntimeException('Missing required parameter "'.$param.'". Optional parameters not currently supported');
                }

                $path = str_replace('{'.$param.'}', $parameters[$param], $path);
            }
        }

        if ($this->request) {
            $path = $this->request->getBaseUrl().$path;

            if ($absolute) {
                $path = $this->request->getSchemeAndHttpHost().$path;
            }
        }

        return $path;
    }
public function generate($name, array $parameters = array(), $absolute = false)
    {
        if (!$this->initialized) {
            $this->initialize();
        }

        $path = $this->routes[$name];
        if (is_array($path)) {
            $params = $path['params'];
            $path = $path['path'];

            foreach ($params as $param) {
                if (!isset($parameters[$param])) {
                    throw new \RuntimeException('Missing required parameter "'.$param.'". Optional parameters not currently supported');
                }

                $path = str_replace('{'.$param.'}', $parameters[$param], $path);
            }
        }

        if ($this->request) {
            $path = $this->request->getBaseUrl().$path;

            if ($absolute) {
                $path = $this->request->getSchemeAndHttpHost().$path;
            }
        }

        return $path;
    }
Generate a URL for the given route

@param string $name       The name of the route to generate a url for
@param array  $parameters Parameters to pass to the route
@param bool   $absolute   If true, the generated route should be absolute

@return string