Hello.
(Symfony) is required to output data from mysql in json format.
Getting an article
$em = $this->getDoctrine()->getManager(); $posts = $em->getRepository('BlogBundle:Post')->findBy([], ['id' => 'DESC'], 1); Json format
return new JsonResponse($posts); Currently prints [{}] . I need to push all the given articles (title, description, etc.) into an array and output using JsonResponse . How can I do it?