WIP
This commit is contained in:
parent
21977588d8
commit
f7fa124535
21 changed files with 388 additions and 58 deletions
35
src/Venom/Admin/AdminController.php
Normal file
35
src/Venom/Admin/AdminController.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Venom\Admin;
|
||||
|
||||
|
||||
use Venom\Helper\URLHelper;
|
||||
use Venom\Views\RenderController;
|
||||
use Venom\Views\VenomRenderer;
|
||||
|
||||
class AdminController implements RenderController
|
||||
|
||||
{
|
||||
|
||||
private string $tpl = 'default';
|
||||
|
||||
public function register(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function render(VenomRenderer $renderer): bool
|
||||
{
|
||||
if (URLHelper::getInstance()->getUrl() !== '/admin/') {
|
||||
http_response_code(404);
|
||||
$this->tpl = 'async';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getTemplate(): string
|
||||
{
|
||||
return $this->tpl;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue