diff --git a/src/Controller/ProfilController.php b/src/Controller/ProfilController.php index 2322baa..fbff2b5 100644 --- a/src/Controller/ProfilController.php +++ b/src/Controller/ProfilController.php @@ -20,8 +20,10 @@ class ProfilController extends AbstractController public function profil(int $id): Response { $profil = $this->mgr->find(Profil::class, $id); + $posts = $profil->getPosts(); return $this->render('profil/index.html.twig', [ - 'profil' => $profil + 'profil' => $profil, + 'posts' => $posts ]); } @@ -30,7 +32,7 @@ class ProfilController extends AbstractController { $profil = $this->mgr->find(Profil::class, $id); if ($profil instanceof Profil) { - $this->curentUser->addFollowing($profil); + $profil->addFollower($this->curentUser); return $this->render('profil/index.html.twig', [ ]); } else { diff --git a/templates/posts/post.detail.html.twig b/templates/posts/post.detail.html.twig new file mode 100644 index 0000000..0e86f85 --- /dev/null +++ b/templates/posts/post.detail.html.twig @@ -0,0 +1,70 @@ +{# templates/post/show.html.twig #} + +{% extends 'base.html.twig' %} + +{% block title %}Post - {{ post.title }}{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block body %} +
{{ post.text }}
+
Commentaires:
+ {% for commentary in post.commentaries %} +