public static function & GetInstance (array $routes = [], $autoInitialize = TRUE) {
		if (!self::$instance) {
			/** @var $app \MvcCore\Application */
			$app = & \MvcCore\Application::GetInstance();
			self::$routeClass = $app->GetRouteClass();
			self::$routerClass = $app->GetRouterClass();
			self::$toolClass = $app->GetToolClass();
			$routerClass = $app->GetRouterClass();
			$instance = new $routerClass($routes, $autoInitialize);
			$instance->application = & $app;
			self::$instance = & $instance;
		}
		return self::$instance;
	}
public static function & GetInstance (array $routes = [], $autoInitialize = TRUE) {
		if (!self::$instance) {
			/** @var $app \MvcCore\Application */
			$app = & \MvcCore\Application::GetInstance();
			self::$routeClass = $app->GetRouteClass();
			self::$routerClass = $app->GetRouterClass();
			self::$toolClass = $app->GetToolClass();
			$routerClass = $app->GetRouterClass();
			$instance = new $routerClass($routes, $autoInitialize);
			$instance->application = & $app;
			self::$instance = & $instance;
		}
		return self::$instance;
	}
public static function & GetInstance ( array $ routes = [ ] , $ autoInitialize = TRUE ) { if ( ! self :: $ instance ) { /** @var $app \MvcCore\Application */ $ app = & \ MvcCore \ Application :: GetInstance ( ) ; self :: $ routeClass = $ app -> GetRouteClass ( ) ; self :: $ routerClass = $ app -> GetRouterClass ( ) ; self :: $ toolClass = $ app -> GetToolClass ( ) ; $ routerClass = $ app -> GetRouterClass ( ) ; $ instance = new $ routerClass ( $ routes , $ autoInitialize ) ; $ instance -> application = & $ app ; self :: $ instance = & $ instance ; } return self :: $ instance ; }
Get singleton instance of `\MvcCore\Router` stored always here.
Optionally set routes as first argument.
Create proper router instance type at first time by
configured class name in `\MvcCore\Application` singleton.

Routes could be defined in various forms:
Example:
`\MvcCore\Router::GetInstance([
"Products:List"	=> "/products-list/<name>/<color>",
]);`
or:
`\MvcCore\Router::GetInstance([
'products_list'	=> [
"pattern"			=> "/products-list/<name>/<color>",
"controllerAction"	=> "Products:List",
"defaults"			=> ["name" => "default-name",	"color" => "red"],
"constraints"		=> ["name" => "[^/]*",			"color" => "[a-z]*"]
]
]);`
or:
`\MvcCore\Router::GetInstance([
new Route(
"/products-list/<name>/<color>",
"Products:List",
["name" => "default-name",	"color" => "red"],
["name" => "[^/]*",		"color" => "[a-z]*"]
)
]);`
or:
`\MvcCore\Router::GetInstance([
new Route(
"name"			=> "products_list",
"pattern"		=> "#^/products\-list/(?<name>[^/]*)/(?<color>[a-z]*)(?=/$|$)#",
"reverse"		=> "/products-list/<name>/<color>",
"controller"	=> "Products",
"action"		=> "List",
"defaults"		=> ["name" => "default-name",	"color" => "red"],
)
]);`
@param \MvcCore\Route[]|\MvcCore\IRoute[]|array $routes
Keyed array with routes, keys are route names or route
`Controller::Action` definitions.
@param bool $autoInitialize
If `TRUE`, locale routes array is cleaned and then all
routes (or configuration arrays) are sent into method
`$router->AddRoutes();`, where are routes auto initialized
for missing route names or route controller or route action
record, completed always from array keys. You can you
`FALSE` to set routes without any change or
auto-initialization, it could be useful to restore cached
routes etc.
@return \MvcCore\Router|\MvcCore\IRouter
Get singleton instance of \ MvcCore \ Router stored always here . Optionally set routes as first argument . Create proper router instance type at first time by configured class name in \ MvcCore \ Application singleton .