Json response.
--- 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)