Ajoute le News Controller

This commit is contained in:
Colin FRIZOT committed 2022-11-22 08:47:06 +01:00
1 parent 86827d1983
commit 53038a5022
3 files changed
+26 -1

No files matched your search

+7
View File
@@ -14,4 +14,11 @@ class UserController
$news = $di->getNewsGateway()->getPaginatedRecentNews();
return new HttpResponse(200, 'home', ['news' => $news]);
}
public function viewPost(DI $di, array $params): HttpResponse
{
$newsId = intval($params['id']);
$news = $di->getNewsGateway()->getById($newsId);
return new HttpResponse(200, 'home', ['news' => $news]);
}
}