I have an action for login process. Now I want to use the same action for normal login process and for ajax requests also.
/**
* @Route("/sponsor/login", name="sponsor_login", options={"expose"=true})
* @Template("SponsorBundle::login.html.twig")
* @return array
*/
public function loginAction()
{}
I want this action to render different view files for xmlhttp request and for normal http request.How do i do that? and I want to pass view file in a json object