src/Lokos/ShopBundle/Controller/BaseController.php
/**
     * Returns json response
     *
     * @param mixed   $data    The response data
     * @param integer $status  The response status code
     * @param array   $headers An array of response headers
     *
     * @return string
     */
Returns json response
@param mixed   $data    The response data
@param integer $status  The response status code
@param array   $headers An array of response headers

@return string
Returns json response @param mixed $data The response data @param integer $status The response status code @param array $headers An array of response headers @return string
protected function jsonResponse($data, $status = JsonResponse::HTTP_OK, $headers = array())
    {
        $headers = array_merge($headers, array('Vary' => 'Accept'));
        return new JsonResponse($data, $status, $headers);
    }
protected function jsonResponse ( $ data , $ status = JsonResponse :: HTTP_OK , $ headers = array ( ) ) { $ headers = array_merge ( $ headers , array ( 'Vary' => 'Accept' ) ) ; return new JsonResponse ( $ data , $ status , $ headers ) ; }
Returns json response
 @param mixed   $data    The response data
 @param integer $status  The response status code
 @param array   $headers An array of response headers
Returns json response @param mixed $data The response data @param integer $status The response status code @param array $headers An array of response headers
//http://stackoverflow.com/questions/15394156/back-button-in-browser-not-working-properly-after-using-pushstate-in-chrome