diff --git a/Kernel/Controller.php b/Kernel/Controller.php index 95ae460..5cf7777 100644 --- a/Kernel/Controller.php +++ b/Kernel/Controller.php @@ -8,7 +8,7 @@ final class controller private $_A_postParams; - public function __construct ($S_url, $A_postParams) + public function __construct ($S_url, $A_postParams, $A_getParams) { // Remove the trailing slash if ('/' == substr($S_url, -1, 1)) { @@ -43,6 +43,8 @@ final class controller $this->_A_postParams = $A_postParams; + $this->_A_getParams = $A_getParams; + } @@ -60,8 +62,11 @@ final class controller } - $B_called = call_user_func_array(array(new $this->_A_urlParts['controller'], - $this->_A_urlParts['action']), array($this->_A_urlParams, $this->_A_postParams )); + $B_called = call_user_func_array(array( + new $this->_A_urlParts['controller'], + $this->_A_urlParts['action']), + array($this->_A_urlParams, $this->_A_postParams, $this->_A_getParams) + ); if (false === $B_called) { throw new ControllerException("Action " . $this->_A_urlParts['action'] . diff --git a/index.php b/index.php index f0c3424..2d13d2d 100644 --- a/index.php +++ b/index.php @@ -9,12 +9,15 @@ $S_url = isset($_GET['url']) ? $_GET['url'] : null; $A_postParams = isset($_POST) ? $_POST : null; + + $A_getParams = isset($_GET) ? $_GET : null; + unset($A_getParams["url"]); View::openBuffer(); try { - $O_controller = new Controller($S_url, $A_postParams); + $O_controller = new Controller($S_url, $A_postParams, $A_getParams); $O_controller->execute(); } catch (ControleurException $O_exception)