public function getUrl($module, $action, $vars = array()) { $found = false; $url = ""; foreach ($this->config->getList('route') as $route) { if (strtolower($module) == strtolower($route['module']) && strtolower($action) == strtolower($route['action'])) { $url = $route['url']; if (isset($route['vars'])) { $varsName = explode(',', $route['vars']); } else { $varsName = array(); } if (sizeof($varsName) == sizeof($vars)) { $url = preg_replace("#\\\\#", "", $url); foreach ($vars as $var) { $url = preg_replace("#\\(.+\\)#", $var, $url, 1); } $found = true; break; } //else // throw new \Exception(ErrorMessage::router(2)); } } if (!$found) { throw new \Exception(ErrorMessage::router(2)); } return $url; }