Create Core/Router and public/index then test the Router
This commit is contained in:
9
public/index.php
Normal file
9
public/index.php
Normal 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);
|
||||
Reference in New Issue
Block a user