Get redirect with saved message

@param string            $route
@param string            $message
@param array             $routeParameters
@param string|null       $routeFragment
@param string|null|false $translationDomain

@return RedirectResponse
186198
public function getSavedRedirect($route, $message = 'flash_bag.success.default', $routeParameters = [], $routeFragment = null, $translationDomain = null)
    {
        $this->addSessionFlashBagMessage($message, Bootstrap4::STATE_SUCCESS, $translationDomain);

        return $this->getRedirectToRoute($route, $routeParameters, UrlGeneratorInterface::ABSOLUTE_PATH, Response::HTTP_FOUND, $routeFragment);
    }
1151965
public function route($route = null, array $params = array(), array $query = array())
    {
        return $this->toRoute($route, $params, $query);
    }
1165717
public function callbackFunction($route = null, $parameters = [])
    {
        if ($route === null || ! is_string($route)) {
            // Gets URI from current request
            $uri = $this->request->getUri();
        } else {
            // Generates URI from '_route'
            $uri = $this->router->generate(
                $route,
                $parameters,
                Router::ABSOLUTE_URL
            );
        }

        $result = parse_url($uri);

        // When uri contains query string
        if (isset($result['query'])) {

            parse_str($result['query'], $query);

            // Remove callback from query
            $query = array_diff_key($query, ['callback' => null]);
        } else {
            // Return unchanged uri
            return $uri;
        }

        return $result['scheme'].'://'.
               (isset($result['user']) ? $result['user'] : '').
               (isset($result['pass']) ? ':'.$result['pass'].'@' : '').
               $result['host'].
               (isset($result['port']) ? ':'.$result['port'] : '').
               (isset($result['path']) ? $result['path'] : '').
               ($query != [] ? '?'.http_build_query($query) : '').
               (isset($result['fragment']) ? '#'.$result['fragment'] : '');
    }
941469
protected function executeAction(Route $route): Response
	{
		$action = $route->getAction();

		$parameters = $route->getParameters();

		if($action instanceof Closure)
		{
			return $this->executeClosure($action, $parameters);
		}

		return $this->executeController($action, $parameters);
	}
462731
public function translate($message, array $params = array())
    {
        // Update the current message with the domain translation, if we have one.
        if (isset($this->messages[$message]) && ! empty($this->messages[$message])) {
            $message = $this->messages[$message];
        }

        if (empty($params)) {
            return $message;
        }

        $formatter = new MessageFormatter();

        return $formatter->format($message, $params, $this->locale);
    }
543640
public function denied($route, $routeParameters = [], $message = 'flash_bag.error.default')
    {
        $this->addSessionFlashBagMessage(self::SESSION_FLASH_BAG_ERROR, $message);

        return $this->redirect($this->generateUrl($route, $routeParameters));
    }
1324174
public function redirectToRoute($route, array $parameters = [], $status = 302)
    {
        return new RedirectResponse($this['url_generator']->generate($route, $parameters), $status);
    }
422272
public static function __($message, $textdomain=false) {
        global $CFG, $PDOX, $TSUGI_LOCALE, $TSUGI_LOCALE_RELOAD, $TSUGI_TRANSLATE;
    
        // If we have been asked to do some translation
        if ( isset($CFG->checktranslation) && $CFG->checktranslation && isset($PDOX) ) 
        {
            $string_sha = U::lti_sha256($message);
            $domain = $textdomain;
            if ( ! $domain ) $domain = textdomain(NULL);
            if ( $domain ) {
                $stmt = $PDOX->queryReturnError("INSERT INTO {$CFG->dbprefix}tsugi_string
                        (domain, string_text, string_sha256) VALUES ( :DOM, :TEXT, :SHA)
                        ON DUPLICATE KEY UPDATE updated_at = NOW()",
                    array(
                        ':DOM' => $domain,
                        ':TEXT' => $message,
                        ':SHA' => $string_sha
                    )
                );
            }
        }

        // Setup Text domain late...
        if ( $TSUGI_LOCALE_RELOAD ) {
            self::setupTextDomain();
        }

        if ( isset($TSUGI_TRANSLATE) && $TSUGI_TRANSLATE ) {
            $retval = $TSUGI_TRANSLATE->trans($message);
            // error_log("DOM=$TSUGI_LOCALE msg=$message trans=$retval");
            return $retval;
        }

        if ( ! function_exists('gettext')) return $message;
        if ( $textdomain === false ) {
            return gettext($message);
        } else {
            return dgettext($textdomain, $message);
        }
    }
526951
public static function getRoute($route, $method=null) {
// 		$routes	= static::getRoutes();
		if( $method ) {
			return isset(static::$routes[$route][$method]) ? static::$routes[$route][$method] : null;
		}
		foreach( static::getKnownMethods() as $method ) {
			if( isset(static::$routes[$route][$method]) ) {
				return static::$routes[$route][$method];
			}
		}
		return null;
	}
84771
public function route($text, $route, $parameters = [], $target = '')
    {
        $href = route($route, $parameters);
        $href .= !empty($target) ? '#'.$target : '';
        return $this->addElement('a')->text($text)
            ->href($href);
    }
586618
public function url($message = null)
    {
        $this->setRule(__FUNCTION__, function($val)
                       {
                           return (strlen(trim($val)) === 0 || filter_var($val, FILTER_VALIDATE_URL) !== FALSE);
                       }, $message);
        return $this;
    }
456939
public function redirectLangSafe($route, $code = null)
    {
        if (!$this['uri']->isExternal($route)) {
            $this->redirect($this['pages']->route($route), $code);
        } else {
            $this->redirect($route, $code);
        }
    }
439553
protected function fromRoute(Router\Route $route)
    {
        return $this->newInstance(
            $route->input,
            $route->domain,
            $route->responder
        );
    }
750560
protected function translateMessage($message, array $parameters = array())
    {
        return $this->translator->trans($message, $parameters, $this->transDomain);
    }
690475
protected function redirectToRefererOrRoute(
        string $routeName,
        array $routeParameters = []
    ): RedirectResponse {
        try {
            return $this->redirectToReferer();
        } catch (CannotRedirectToEmptyRefererUrlException $exception) {
            return $this->redirectToRoute($routeName, $routeParameters);
        }
    }
892525
public function handleInternal(string $path, string $message = null)
    {
        $route = $this->internalRoutes[$path]
            ?? $this->internalRoutes[null]
            ?? null;

        if (!$route) {
            throw new NotFoundException("No internal route to handle: " . $path);
        }

        $this->errorMessage = $message;
        if ($message) {
            $route->setArguments([$message]);
        }

        $route->setMatchedPath($path);
        $this->lastRoute = $route;
        return $route->handle(null, $this->di);
    }
260231
public function handle(RouteInterface $route)
    {
        $params = [];

        // create the regex that matches paths against the route
        $patternRegex = $this->createRouteRegex($route, $route->getPattern(), $params);

        // if the route regex matches the current request path
        if (preg_match($patternRegex, $route->getRoute(), $matches)) {
            if (count($matches) > 1) {
                // remove the first match (which is the full route match)
                array_shift($matches);

                // use the extracted parameters as the arguments' keys and the matches as the arguments' values
                return array_combine($params, $matches);
            } else {
                return [];
            }
        }
        // if the route regex does not match the current request path returns null
    }