Будь проклят тот день, когда я решил ввести неймспейсы...

This commit is contained in:
lopar
2020-10-28 22:21:08 +02:00
parent f1b9ce6a45
commit d38d62c5b5
159 changed files with 339 additions and 304 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
# Date: 30.09.2020 (09:42)
namespace Battles;
class Template
{
/**
* Template constructor.
*/
public function __construct()
{
}
/**
* @param string|null $title
* @param int|null $return
*
* @return false|string
*/
public static function header(string $title = null, int $return = null)
{
$head = <<<HTML_HEADER
<!doctype html>
<html lang="ru">
<meta charset="utf-8">
<link href="/css/main.css" rel="stylesheet">
<link href="/css/btn.css" rel=stylesheet >
<title>$title</title>
HTML_HEADER;
if (!$return) {
echo $head;
return false;
}
return $head;
}
/**
* @param string $buildingName название здания
* @param string $streetName служебное название улицы на которой стоит здание для кнопки возврата.
* @return string
*/
public static function buildingTop(string $buildingName, string $streetName): void
{
echo <<<HTML
<div style="float: right">
<button onclick="top.frames['gameframe'].location = 'city.php?$streetName'">Выйти из здания</button>
</div>
<h1>$buildingName</h1>
HTML;
}
}