Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Pulling records from database to javascript by Symfony2 controller

Current License: CC BY-SA 3.0

15 events
when toggle format what by license comment
Aug 1, 2013 at 14:29 vote accept Tomasz Buczeń
Aug 1, 2013 at 14:28 history edited Tomasz Buczeń CC BY-SA 3.0
added 763 characters in body
Aug 1, 2013 at 14:25 comment added Tomasz Buczeń Ok, I've solved the problem using serializer. I'll paste solution right now
Aug 1, 2013 at 13:36 comment added RONE Refer this: stackoverflow.com/questions/4697656/…
Aug 1, 2013 at 13:29 comment added RONE There you are, dear, you are returning the object array, that will not be converted into normal array, try itterating the array in php itself and create a normal array, then the flow will work
Aug 1, 2013 at 13:26 comment added Pawel You have ready solution with json object in response in comment below.
Aug 1, 2013 at 13:26 comment added Tomasz Buczeń 2. After console.log(data) - the output is [15:20:47.122] ({responseCode:200, categories:[{}, {}, {}, {}, {}]})
Aug 1, 2013 at 13:25 comment added Tomasz Buczeń the output is like this:array(5) { [0]=> object(Proj\DataBundle\Entity\Category)#333 (2) { ["name":"Proj\DataBundle\Entity\Category":private]=> string(8) "Test2" ["id":"Proj\DataBundle\Entity\Category":private]=> int(17) } [1]=> object(Proj\DataBundle\Entity\Category)#334 (2) { ["name":"Proj\DataBundle\Entity\Category":private]=> string(10) "Multimedia" ["id":"Proj\DataBundle\Entity\Category":private]=> int(15) }... }
Aug 1, 2013 at 13:24 comment added RONE can you tell me the status of 2. if you are getting the value for $categories, then try to console.log(data); So that i can get some clue by any chance
Aug 1, 2013 at 13:22 comment added Tomasz Buczeń @SAM 1. I've made test function before at php side and it contains variables it looks like this : public function testAction(){ $categories = $this->getDoctrine()->getRepository('VelrezDataBundle:Category')->findAll(); return new Response(var_dump( $categories )); }
Aug 1, 2013 at 13:16 comment added RONE Few tips, 1. Are you getting the $categories array in php side, 2. if you are getting the value for $categories, then try to console.log(data); 3. define the categories : var categories = data.categories; Let me know the result
Aug 1, 2013 at 13:16 answer added Pawel timeline score: 2
Aug 1, 2013 at 13:12 review First posts
Aug 1, 2013 at 13:13
Aug 1, 2013 at 13:12 history edited Tomasz Buczeń CC BY-SA 3.0
added 75 characters in body; edited title
Aug 1, 2013 at 12:57 history asked Tomasz Buczeń CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /