src/Ubiquity/controllers/Controller.php
public function redirectToRoute($routeName, $parameters = [], $initialize = false, $finalize = false) {
		$path = Router::getRouteByName ( $routeName, $parameters );
		if ($path !== false) {
			$route = Router::getRoute ( $path, false );
			if ($route !== false) {
				$this->forward ( $route [0], $route [1], \array_slice ( $route, 2 ), $initialize, $finalize );
			} else {
				throw new RouterException ( "Route {$routeName} not found", 404 );
			}
		} else {
			throw new RouterException ( "Route {$routeName} not found", 404 );
		}
	}
public function redirectToRoute($routeName, $parameters = [], $initialize = false, $finalize = false) {
		$path = Router::getRouteByName ( $routeName, $parameters );
		if ($path !== false) {
			$route = Router::getRoute ( $path, false );
			if ($route !== false) {
				$this->forward ( $route [0], $route [1], \array_slice ( $route, 2 ), $initialize, $finalize );
			} else {
				throw new RouterException ( "Route {$routeName} not found", 404 );
			}
		} else {
			throw new RouterException ( "Route {$routeName} not found", 404 );
		}
	}
public function redirectToRoute ( $ routeName , $ parameters = [ ] , $ initialize = false , $ finalize = false ) { $ path = Router :: getRouteByName ( $ routeName , $ parameters ) ; if ( $ path !== false ) { $ route = Router :: getRoute ( $ path , false ) ; if ( $ route !== false ) { $ this -> forward ( $ route [ 0 ] , $ route [ 1 ] , \ array_slice ( $ route , 2 ) , $ initialize , $ finalize ) ; } else { throw new RouterException ( "Route {$routeName} not found" , 404 ) ; } } else { throw new RouterException ( "Route {$routeName} not found" , 404 ) ; } }
Redirect to a route by its name

@param string $routeName The route name
@param array $parameters The parameters to pass to the route action
@param boolean $initialize Call the **initialize** method if true
@param boolean $finalize Call the **finalize** method if true
@throws RouterException
Redirect to a route by its name