modifs!!!!

This commit is contained in:
2019-02-18 15:05:33 +01:00
parent 7bd6b67ccf
commit c4177f1f10
14 changed files with 158 additions and 84 deletions

View File

@ -1,9 +1,11 @@
<?php
include_once "router.php";
//recupération du router
//recup<EFBFBD>ration du router
$router = Router::getRouter();
$postCharacters = "[a-z0-9-]";
//page d'accueil
$home = function () {
return file_get_contents("../html/index.html");
@ -16,7 +18,7 @@ $post = function () {
return file_get_contents("../html/post.html");
};
$router->addRoute("/^\/post\/$/", $post); // route "/post/*"
$router->addRoute("/^\/post\/" + $postCharacters + "+\/*$/", $post); // route "/post/*"
//page de recherche
$search = function () {
@ -24,3 +26,9 @@ $search = function () {
};
$router->addRoute("/^\/search\/$/", $search); // route "/search/*"
$post = function() {
var_dump("tst");
};
$router->addRoute("/^\/post\/" + $postCharacters + "+\/edit\/*$/", $post);