This commit is contained in:
2025-07-03 23:46:08 +03:00
parent 7fe2402ff3
commit ab4499a305
39 changed files with 453 additions and 56 deletions

16
src/router.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
/**
* @package: patterns
* @author: Yevhen Odynets
* @date: 2025-07-03
* @time: 21:26
*/
declare(strict_types = 1);
preg_match('/^\/patterns\/([a-z0-9-]+)/', $_SERVER["REQUEST_URI"], $patterns);
if (isset($patterns[1]) && file_exists('../code/' . $patterns[1] . '.php')) {
require '../code/' . $patterns[1] . '.php';
}