-1
私の問題は、このメソッドが真の結果を返さないということです。 入力の電子メールが自分のエンティティに存在するかどうかをテストします。ここでSymfony2でAjaxリクエストを作成
はコントローラです:
public function verificationAction(Request $request)
{
if ($this->container->get('request')->isXmlHttpRequest()) {
$email=$request->request->get('email');
$em=$this->getDoctrine()->getEntityManager();
$resp= $em->getRepository("CMSiteBundle:Prospect")->findBy(array('email'=>$email));
$response =new Response(json_encode($resp));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
}