public function getUrl(string $sCode, array $aParams = array()) : string
    {
        if (isset($_SERVER) && isset($_SERVER['HTTP_HOST'])) {

            foreach (Config::get('route') as $sHost => $oHost) {

                if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST'])
                    || (strstr($sHost, '/')
                    && strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {

                    if (strstr($sHost, '/')
                        && strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost)) {

                        $this->_sBaseUri = preg_replace('#^[^/]+#', '', $sHost);
                    }

                    if (isset($oHost->routes)) {

                        foreach($oHost->routes as $sKey => $oRoute) {

                            if ($sKey === $sCode) {

                                $sRoute = $this->_sBaseUri.$oRoute->route;

                                if (isset($oRoute->constraints)) {

                                    foreach ($oRoute->constraints as $sName => $sType) {

                                        if (!isset($aParams[$sName])) { $aParams[$sName] = ''; }

                                        if (preg_match('#'.$sType.'#', $aParams[$sName])) {

                                            if ($aParams[$sName]) { $sRoute = str_replace('[/:'.$sName.']', '/'.$aParams[$sName], $sRoute); } else { $sRoute = str_replace('[/:'.$sName.']', '', $sRoute); }
                                            $sRoute = str_replace('[:'.$sName.']', $aParams[$sName], $sRoute);
                                            continue;
                                        } else if (isset($oRoute->defaults_constraints)
                                            && isset($oRoute->defaults_constraints->{$sName})
                                            && preg_match('#'.$sType.'#', $oRoute->defaults_constraints->{$sName})) {

                                            continue;
                                        }

                                        throw new \Exception('For the route '.$sCode.' the parameter '.$sName.' is not good!');
                                    }
                                }

                                return $sRoute;
                            }
                        }
                    }
                }
            }
        }
    }