idk anymore! please put the dog down (me)!
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Controllers;
|
||||
|
||||
use PDO;
|
||||
use src\View;
|
||||
use src\ViewModels\HomeData;
|
||||
|
||||
class HomeController
|
||||
{
|
||||
public function __construct(
|
||||
private PDO $db
|
||||
) {}
|
||||
|
||||
public function index(): void
|
||||
{
|
||||
$data = new HomeData(
|
||||
pageTitle: 'Welcome to Pawra',
|
||||
posts: $this->db->query("SELECT * FROM posts LIMIT 10")->fetchAll()
|
||||
);
|
||||
|
||||
View::render('home', $data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user