Json response.
authorhiroto
Wed, 04 Sep 2013 14:35:39 +0900
changeset 45 a74db3342d2d
parent 44 7fb399f217bd
child 46 2adb46f4fa0e
Json response.
autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php
--- a/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php	Wed Sep 04 14:21:35 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php	Wed Sep 04 14:35:39 2013 +0900
@@ -7,6 +7,7 @@
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\JsonResponse;
 
 class DefaultController extends Controller
 {
@@ -44,8 +45,12 @@
         }else{
             $valid='false';
         }
-            
-        return $this->render('OrgW3AutotweetBundle:Default:checkkey.json.twig', array('valid' => $valid));
+        $response = new JsonResponse();
+        $response->setData(array(
+            'accepted' => $valid
+        ));
+        return $response;
+        //return $this->render('OrgW3AutotweetBundle:Default:checkkey.json.twig', array('valid' => $valid));
     }
     
     public function newTalkAction(Request $request)