diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-14 22:44:25 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-14 22:44:25 -0500 |
commit | b081288188bb1744c9d7bd075aa5936e0ccbb9c4 (patch) | |
tree | 68008e35eb129f74b9b2a49f6f6076ed02b601c6 /app/Core/Router.php | |
parent | 1487cb27634161ef558c367150213bc7077e4198 (diff) |
Use Pimple instead of Core\Registry and add Monolog for logging
Diffstat (limited to 'app/Core/Router.php')
-rw-r--r-- | app/Core/Router.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/Core/Router.php b/app/Core/Router.php index c9af6e2c..1750753c 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -2,6 +2,8 @@ namespace Core; +use Pimple\Container; + /** * Router class * @@ -27,24 +29,24 @@ class Router private $action = ''; /** - * Registry instance + * Container instance * * @access private - * @var \Core\Registry + * @var Pimple\Container */ - private $registry; + private $container; /** * Constructor * * @access public - * @param Registry $registry Registry instance - * @param string $controller Controller name - * @param string $action Action name + * @param Pimple\Container $container Container instance + * @param string $controller Controller name + * @param string $action Action name */ - public function __construct(Registry $registry, $controller = '', $action = '') + public function __construct(Container $container, $controller = '', $action = '') { - $this->registry = $registry; + $this->container = $container; $this->controller = empty($_GET['controller']) ? $controller : $_GET['controller']; $this->action = empty($_GET['action']) ? $action : $_GET['action']; } @@ -81,7 +83,7 @@ class Router return false; } - $instance = new $class($this->registry); + $instance = new $class($this->container); $instance->request = new Request; $instance->response = new Response; $instance->session = new Session; |