From 2d189b7baefefc0a581f5dfc606d73a3837d72ed Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 12 Dec 2016 20:24:09 +0100 Subject: [PATCH] Added simplified static router:2.0 call --- src/packages/router/2.0/core/Router.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/packages/router/2.0/core/Router.php b/src/packages/router/2.0/core/Router.php index 5fc72ff..f2200a7 100644 --- a/src/packages/router/2.0/core/Router.php +++ b/src/packages/router/2.0/core/Router.php @@ -17,6 +17,7 @@ class Router{ + /* [1] Attributes =========================================================*/ private $url; // current URL @@ -33,6 +34,17 @@ public static function randBoundary(){ return dechex( random_int((int) 1e10, (int) 1e20) ); } + // Instance getter + public static function launch($url=null){ + /* (1) Instanciate the router (propagation) */ + $instance = new Router($url); + + + /* (2) Launches the router */ + $instance->run(); + + } + /* [3] Constructor *