protected function urlRoute($module, $controller, $params): string
    {
        $url = $this->getBaseUrl();

        if (empty($params) && $controller === self::DEFAULT_CONTROLLER) {
            if ($module === self::DEFAULT_MODULE) {
                return $url;
            }
            return $url . $module;
        }

        $url .= $module . '/' . $controller;
        $getParams = [];
        foreach ($params as $key => $value) {
            // sub-array as GET params
            if (\is_array($value)) {
                $getParams[$key] = $value;
                continue;
            }
            $url .= '/' . urlencode((string)$key) . '/' . urlencode((string)$value);
        }
        if (!empty($getParams)) {
            $url .= '?' . http_build_query($getParams);
        }
        return $url;
    }
protected function urlRoute($module, $controller, $params): string
    {
        $url = $this->getBaseUrl();

        if (empty($params) && $controller === self::DEFAULT_CONTROLLER) {
            if ($module === self::DEFAULT_MODULE) {
                return $url;
            }
            return $url . $module;
        }

        $url .= $module . '/' . $controller;
        $getParams = [];
        foreach ($params as $key => $value) {
            // sub-array as GET params
            if (\is_array($value)) {
                $getParams[$key] = $value;
                continue;
            }
            $url .= '/' . urlencode((string)$key) . '/' . urlencode((string)$value);
        }
        if (!empty($getParams)) {
            $url .= '?' . http_build_query($getParams);
        }
        return $url;
    }
protected function urlRoute ( $ module , $ controller , $ params ) : string { $ url = $ this -> getBaseUrl ( ) ; if ( empty ( $ params ) && $ controller === self :: DEFAULT_CONTROLLER ) { if ( $ module === self :: DEFAULT_MODULE ) { return $ url ; } return $ url . $ module ; } $ url .= $ module . '/' . $ controller ; $ getParams = [ ] ; foreach ( $ params as $ key => $ value ) { // sub-array as GET params if ( \ is_array ( $ value ) ) { $ getParams [ $ key ] = $ value ; continue ; } $ url .= '/' . urlencode ( ( string ) $ key ) . '/' . urlencode ( ( string ) $ value ) ; } if ( ! empty ( $ getParams ) ) { $ url .= '?' . http_build_query ( $ getParams ) ; } return $ url ; }
Build URL by default route

@param  string $module
@param  string $controller
@param  array  $params

@return string
Build URL by default route