aboutsummaryrefslogtreecommitdiff
path: root/app/class/Routes.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-04-17 19:01:05 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-04-17 19:01:05 +0200
commit802f5135b0979bab3bf30ae1733f9867e2caed7a (patch)
tree3575cb7dd353e7f1ce74b079aa1559b5d69054bf /app/class/Routes.php
parent74e2b3fdd66bfbe99bae771fa3a0b6c427fc0f86 (diff)
downloadwcms-802f5135b0979bab3bf30ae1733f9867e2caed7a.tar.gz
wcms-802f5135b0979bab3bf30ae1733f9867e2caed7a.zip
apply psr12
Diffstat (limited to 'app/class/Routes.php')
-rw-r--r--app/class/Routes.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/app/class/Routes.php b/app/class/Routes.php
index 03e193c..c58de95 100644
--- a/app/class/Routes.php
+++ b/app/class/Routes.php
@@ -12,7 +12,7 @@ class Routes
public function match()
{
$router = new AltoRouter();
- if(!empty(Config::basepath())) {
+ if (!empty(Config::basepath())) {
$router->setBasePath('/' . Config::basepath());
}
$router->addMatchTypes(array('cid' => '[a-zA-Z0-9-_+,\'!%@&.$€=\(\|\)]+'));
@@ -72,17 +72,10 @@ class Routes
$methodName = $callableParts[1];
$controller = new $controllerName($router);
-
+
call_user_func_array(array($controller, $methodName), $match['params']);
- }
- //404
- else {
- if(!empty(Config::route404())) {
- $controller = new Controller($router);
- $controller->routedirect('pageread/', ['page' => Config::route404()]);
- } else {
- header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
- }
+ } else {
+ header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
}
}
-} \ No newline at end of file
+}