add GET params to the kernel

This commit is contained in:
Thomas Rubini 2023-01-20 10:51:49 +01:00
parent 91d0fb0b7d
commit 3f9607d5f2
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373
2 changed files with 12 additions and 4 deletions

View File

@ -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'] .

View File

@ -10,11 +10,14 @@
$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)