Initial dev export (exclude uploads/runtime)
This commit is contained in:
31
modules/artists/ArtistsController.php
Normal file
31
modules/artists/ArtistsController.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Artists;
|
||||
|
||||
use Core\Http\Response;
|
||||
use Core\Views\View;
|
||||
|
||||
class ArtistsController
|
||||
{
|
||||
private View $view;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->view = new View(__DIR__ . '/views');
|
||||
}
|
||||
|
||||
public function index(): Response
|
||||
{
|
||||
return new Response($this->view->render('site/index.php', [
|
||||
'title' => 'Artists',
|
||||
]));
|
||||
}
|
||||
|
||||
public function show(): Response
|
||||
{
|
||||
return new Response($this->view->render('site/show.php', [
|
||||
'title' => 'Artist Profile',
|
||||
]));
|
||||
}
|
||||
}
|
||||
13
modules/artists/module.php
Normal file
13
modules/artists/module.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Core\Http\Router;
|
||||
use Modules\Artists\ArtistsController;
|
||||
|
||||
require_once __DIR__ . '/ArtistsController.php';
|
||||
|
||||
return function (Router $router): void {
|
||||
$controller = new ArtistsController();
|
||||
$router->get('/artists', [$controller, 'index']);
|
||||
$router->get('/artist', [$controller, 'show']);
|
||||
};
|
||||
12
modules/artists/views/site/index.php
Normal file
12
modules/artists/views/site/index.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$pageTitle = 'Artists';
|
||||
ob_start();
|
||||
?>
|
||||
<section class="card">
|
||||
<div class="badge">Artists</div>
|
||||
<h1 style="margin-top:16px; font-size:28px;">Artists</h1>
|
||||
<p style="color:var(--muted);">Artist module placeholder.</p>
|
||||
</section>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../../../views/site/layout.php';
|
||||
12
modules/artists/views/site/show.php
Normal file
12
modules/artists/views/site/show.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$pageTitle = 'Artist';
|
||||
ob_start();
|
||||
?>
|
||||
<section class="card">
|
||||
<div class="badge">Artist</div>
|
||||
<h1 style="margin-top:16px; font-size:28px;">Artist profile</h1>
|
||||
<p style="color:var(--muted);">Artist profile placeholder.</p>
|
||||
</section>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../../../views/site/layout.php';
|
||||
Reference in New Issue
Block a user