Ajoute le News Controller
This commit is contained in:
1 parent
86827d1983
commit
53038a5022
3 files changed
+26
-1
No files matched your search
@@ -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]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user