public function handle () {
$match = $this->router->match(new Request());
- var_dump($this->router->getRoutes());
if ($match !== null) {
foreach ($match->getParams() as $key => $value) {
$_GET[$key] = $value;
$className = $match->getParam("controller");
if (!User::isLoggedIn() && $className != 'dns\page\LoginPage' && $className != 'dns\page\ApiPage') {
- echo $className;
DNS::getTPL()->display('login.tpl');
exit;
}
}
public function getPath() {
- return $_SERVER['QUERY_STRING'];
+ $queryString = $_SERVER['QUERY_STRING'];
+
+ if (strpos($queryString, '&') !== false) {
+ $pos = strpos($queryString, '&');
+ $queryString = substr($queryString, 0, $pos);
+ }
+ echo $queryString;
+ return $queryString;
}
}