'productdetails', 'id' => di('request')->get('id'), ]; if($controller) { $urlData['mg-page'] = $controller; } if($isModParam) { $urlData['modop'] = 'custom'; } if($isAParam) { $urlData['a'] = 'management'; } if($action) { $urlData['mg-action'] = $action; } /** * build uri */ $url = BuildUrlExtended::FILE_URI.'?'.http_build_query($urlData); /** * get base URL */ $baseUrl = self::baseUrl(); /** * build full url */ $url = $baseUrl . $url; return $url; } /** * @return string */ private static function baseUrl() { $protocol = 'https'; if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') { $protocol = 'http'; } $host = $_SERVER['HTTP_HOST']; $surfix = $_SERVER['PHP_SELF']; $surfix = explode('/', $surfix); array_pop($surfix); $surfix = implode('/', $surfix); return "{$protocol}://{$host}{$surfix}/"; } }