Add my template project

This commit is contained in:
2024-08-09 21:30:13 +05:00
parent 0e0ac4f094
commit 832bf929dc
19 changed files with 243 additions and 0 deletions

0
template/css/style.css Normal file
View File

8
template/footer.php Normal file
View File

@ -0,0 +1,8 @@
</main>
<footer>
<hr>
<p>&copy; Тестовый сайт 2024</p>
</footer>
</body>
</html>

19
template/header.php Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?=$config['root']['description']?>">
<meta name="keywords" content="<?=implode(', ', $config['root']['keywords'])?>">
<link rel="stylesheet" href="<?=__CS__?>style.css?v=1">
<script src="<?=__JS__?>index.js?v=1"></script>
<title><?=$config['root']['title']?></title>
</head>
<body>
<header>
<h1>Тестовый REST API сайт</h1>
<hr>
</header>
<main>

4
template/index.php Normal file
View File

@ -0,0 +1,4 @@
<?php
include __TD__.'header.php';
include __TD__.'route.php';
include __TD__.'footer.php';

0
template/js/index.js Normal file
View File

1
template/main.php Normal file
View File

@ -0,0 +1 @@
<p>Прочтите <b>README.md</b> файл для получения информации по API.</p>

7
template/route.php Normal file
View File

@ -0,0 +1,7 @@
<?php
if(__URI__ == '/' || in_array(__URL__[0], ['index', 'route', 'header', 'footer']))
header('Location: /main');
elseif(file_exists(__TD__.__URL__[0].'.php'))
require __TD__.__URL__[0].'.php';
else
header('Location: /');