src/Controller/ArticleController.php
public function ReadAction()
  {
    // Gets the article id, then stores it
    $id = $_GET['id'];

    // Reads the article & his comments, then stores them
    $article  = ModelFactory::get('Article')->read($id);
    $comments = ModelFactory::get('Comment')->list($id, 'article_id');

    if(!empty($comments))
    {
      // Loops on each comment
      for ($i = 0; $i < count($comments); $i++)
      {
        // Stores the comment user_id value
        $userId = $comments[$i]['user_id'];

        // Reads the user table with $userId instead of the user id value, then stores the user results
        $user = ModelFactory::get('User')->read($userId);

        // Stores the first_name value & the image value with new keys
        $comments[$i]['user']   = $user['first_name'];
        $comments[$i]['image']  = $user['image'];
      }
    }
    // Returns the rendering of the view readArticle with the article & his comments
    return $this->render('blog/readArticle.twig', [
      'article'   => $article,
      'comments'  => $comments
    ]);
  }
public function ReadAction()
  {
    // Gets the article id, then stores it
    $id = $_GET['id'];

    // Reads the article & his comments, then stores them
    $article  = ModelFactory::get('Article')->read($id);
    $comments = ModelFactory::get('Comment')->list($id, 'article_id');

    if(!empty($comments))
    {
      // Loops on each comment
      for ($i = 0; $i < count($comments); $i++)
      {
        // Stores the comment user_id value
        $userId = $comments[$i]['user_id'];

        // Reads the user table with $userId instead of the user id value, then stores the user results
        $user = ModelFactory::get('User')->read($userId);

        // Stores the first_name value & the image value with new keys
        $comments[$i]['user']   = $user['first_name'];
        $comments[$i]['image']  = $user['image'];
      }
    }
    // Returns the rendering of the view readArticle with the article & his comments
    return $this->render('blog/readArticle.twig', [
      'article'   => $article,
      'comments'  => $comments
    ]);
  }
***********************************************************\
Reads an article, his comments & attributes the user comments
@return mixed => the rendering of the view readArticle