diff --git a/src/Pecee/Router.php b/src/Pecee/Router.php index 0755832..d3a5c72 100644 --- a/src/Pecee/Router.php +++ b/src/Pecee/Router.php @@ -9,10 +9,16 @@ namespace Pecee; +use Pecee\Router\RouterGroup; +use Pecee\Router\RouterRoute; use Pecee\Router\SimpleRouter; class Router { + public static function init() { + SimpleRouter::GetInstance()->routeRequest(); + } + public static function get($url, $callback) { $route = new RouterRoute($url, $callback); $route->addRequestType(RouterRoute::REQUEST_TYPE_GET); diff --git a/src/Pecee/Router/RouterRoute.php b/src/Pecee/Router/RouterRoute.php index c3bd5ea..5766ef5 100644 --- a/src/Pecee/Router/RouterRoute.php +++ b/src/Pecee/Router/RouterRoute.php @@ -15,9 +15,6 @@ class RouterRoute extends RouterEntry { $this->callback = $callback; $this->settings['aliases'] = array(); - - // Set default namespace - $this->namespace = Registry::GetInstance()->get(SimpleRouter::SETTINGS_APPNAME, false) . '\\' . 'Controller'; } public function getRoute($requestMethod, &$url) { diff --git a/src/Pecee/Router/SimpleRouter.php b/src/Pecee/Router/SimpleRouter.php index 328a222..d1481e0 100644 --- a/src/Pecee/Router/SimpleRouter.php +++ b/src/Pecee/Router/SimpleRouter.php @@ -3,8 +3,6 @@ namespace Pecee\Router; class SimpleRouter { - const SETTINGS_APPNAME = 'AppName'; - protected static $instance; protected $currentRoute; @@ -13,15 +11,8 @@ class SimpleRouter { protected $requestUri; protected $requestMethod; protected $loadedClass; - protected $appName; public function __construct() { - - $this->appName = Registry::GetInstance()->get(self::SETTINGS_APPNAME, false); - if (!$this->appName) { - throw new RouterException('"AppName" registry key not defined!', 2); - } - $this->routes = array(); $this->backstack = array(); $this->requestUri = rtrim($_SERVER['REQUEST_URI'], '/');