starting shit oops forgot the db
This commit is contained in:
commit
9e17051db3
5 changed files with 328 additions and 0 deletions
19
index.php
Normal file
19
index.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
require_once 'AltoRouter.php';
|
||||
$router = new AltoRouter();
|
||||
$router->addRoutes(array(
|
||||
array('GET', 'story/[i:page]', 'pages/story.php', 'story'),
|
||||
));
|
||||
|
||||
$router->setBasePath('/');
|
||||
|
||||
$match = $router->match(urldecode($_SERVER['REQUEST_URI']));
|
||||
if ($match) {
|
||||
foreach ($match['params'] as &$param) {
|
||||
${key($match['params'])} = $param;
|
||||
}
|
||||
require_once $match['target'];
|
||||
} else {
|
||||
http_response_code(404);
|
||||
exit('Page not found');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue