20240814#2

This commit is contained in:
User
2024-08-14 21:27:27 +03:00
parent 72d2445bb2
commit 99f78f7362
11 changed files with 14 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Infrastructure\Controllers;
use Base\Infrastructure\Controllers\AbstractPageController;
use Psr\Http\Message\ResponseInterface;
class IndexController extends AbstractPageController {
/**
* @return bool|ResponseInterface
*/
public function index() : bool|ResponseInterface {
try {
//$this->addHeader("App-Mode", "Dev");
$this->template()->setValue("title", "Главная");
}
catch(\Throwable $e){$error = $this->checkError($e);}
return $this->renderResponse("main", "@main/index.tpl", [
"date" => (new \DateTime())->format('Y-m-d H:i:s'),
"error" => $error ?? null
]);
}
}

View File

View File

@@ -0,0 +1,8 @@
<article>
<main>
<div class="main-block">
<div class="main-block__header">Hello</div>
<div class="main-block__text">Now is <?= $this->date ?></div>
</div>
</main>
</article>