public static function url($action = null, $module = null, $extension = null, $params = array())
    {

        if (is_null($module)) {
            $module = Context::getInstance()->getModuleName();
        }
        if (is_null($action)) {
            $action = Context::getInstance()->getActionName();
        }
        if (is_null($extension)) {
            $extension = Context::getInstance()->getExtensionName();
        }

        $returnValue = self::getRootUrl() . $extension . '/' . $module . '/' . $action;

        if (is_string($params) && strlen($params) > 0) {
            $returnValue .= '?' . $params;
        }

        if (is_array($params) && count($params) ) {
            $returnValue .= '?';
            foreach ($params as $key => $value) {
                $returnValue .= $key . '=' . rawurlencode($value) . '&';
            }
            $returnValue = substr($returnValue, 0, -1);
        }

        return $returnValue;
    }