Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] Porblem z json
rychu123
post
Post #1





Grupa: Zarejestrowani
Postów: 194
Pomógł: 1
Dołączył: 18.09.2008

Ostrzeżenie: (0%)
-----


Witam, mam pewien problem. Wyciągam dane z bazy i chce wrzuci dane do json. Problem jest w tym ze dostaje puste dane w json tzn


[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{
},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{
},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{
},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{
},{},{},{},{},{},{},{}]


  1. $e = $this->getDoctrine()->getManager();
  2.  
  3. $clients = $e->getRepository('AppBundle:Client')->findAll();
  4.  
  5. // return $this->render('client/index.html.twig', array(
  6. //'clients' => $clients ));
  7.  
  8. return new Response(json_encode($clients), Response::HTTP_OK, array(
  9. 'Content-Type' => 'application/json' ));
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 21:39