aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/Controllers/HomeController.php
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-03-21 20:50:43 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-03-21 20:50:43 +0100
commitd1ef15fa39935bfa0420c5ac2b8c269e294c9a6d (patch)
tree618158449863123f6b9527b9db6183f8c3ce5c91 /src/app/Controllers/HomeController.php
downloadcamagru-d1ef15fa39935bfa0420c5ac2b8c269e294c9a6d.tar.gz
camagru-d1ef15fa39935bfa0420c5ac2b8c269e294c9a6d.zip
Initial project scaffold
Set up MVC architecture with front controller, router, autoloader, database singleton, and Docker Compose stack (Nginx + PHP-FPM + MariaDB). Includes DB schema, responsive layout, dev tooling (php-cs-fixer, parallel-lint), and documentation.
Diffstat (limited to 'src/app/Controllers/HomeController.php')
-rw-r--r--src/app/Controllers/HomeController.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/app/Controllers/HomeController.php b/src/app/Controllers/HomeController.php
new file mode 100644
index 0000000..8c462a0
--- /dev/null
+++ b/src/app/Controllers/HomeController.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+// Handles the home page and verifies database connectivity.
+
+namespace App\Controllers;
+
+use App\Database;
+
+class HomeController
+{
+ public function index(): void
+ {
+ $db = Database::getInstance()->getPdo();
+ $stmt = $db->query('SELECT 1');
+ $dbStatus = $stmt ? 'Connected' : 'Failed';
+
+ $content = __DIR__ . '/../Views/home/index.php';
+ include __DIR__ . '/../Views/layouts/main.php';
+ }
+}