Create Core/Router and public/index then test the Router

This commit is contained in:
2017-08-31 08:59:49 +07:00
parent 6b5fe0eadf
commit ffea1b6b6c
3 changed files with 173 additions and 0 deletions

9
public/index.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
$router = new Router();
$router->add('', ['controller' => 'Data', 'action' => 'index']);
$router->add('{controller}/{action}');
$router->add('{controller}/{id:\d+}/{action}');
$url = $_SERVER['QUERY_STRING'];
$router->dispatch($url);