aboutsummaryrefslogtreecommitdiff
path: root/app/class/routes.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/class/routes.php')
-rw-r--r--app/class/routes.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/class/routes.php b/app/class/routes.php
index bd9fd71..89f82e6 100644
--- a/app/class/routes.php
+++ b/app/class/routes.php
@@ -9,11 +9,19 @@ class Routes
public function match()
{
$router = new AltoRouter();
- $router->setBasePath('/' . Config::basepath());
+ if(!empty(Config::basepath())) {
+ $router->setBasePath(DIRECTORY_SEPARATOR . Config::basepath());
+ }
$router->addRoutes([
['GET|POST', '/', 'Backrouter#run', 'backrouter'],
['GET', '/[a:art]/', 'Controllerart#read', 'artread/'],
- ['GET', '/[a:art]/edit/', 'Controllerart#edit', 'artedit/'],
+ ['GET', '/[a:art]', 'Controllerart#read', 'artread'],
+ ['GET', '/[a:art]/add', 'Controllerart#add', 'artadd'],
+ ['GET', '/[a:art]/edit', 'Controllerart#edit', 'artedit'],
+ ['GET', '/[a:art]/log', 'Controllerart#log', 'artlog'],
+ ['POST', '/[a:art]/edit', 'Controllerart#update', 'artupdate'],
+ ['GET', '/[a:art]/delete', 'Controllerart#confirmdelete', 'artconfirmdelete'],
+ ['POST', '/[a:art]/delete', 'Controllerart#delete', 'artdelete'],
]);
$match = $router->match();