src/Controller/ProfilerController.php
public function flagAction(Request $request, $token)
    {
        if (!$request->isXmlHttpRequest()) {
            return $this->redirectToRoute('_profiler', ['token' => $token]);
        }

        $message = $this->getMessage($request, $token);

        $saved = $this->get('happyr.translation')->flagTranslation($message);

        return new Response($saved ? 'OK' : 'ERROR');
    }
public function flagAction(Request $request, $token)
    {
        if (!$request->isXmlHttpRequest()) {
            return $this->redirectToRoute('_profiler', ['token' => $token]);
        }

        $message = $this->getMessage($request, $token);

        $saved = $this->get('happyr.translation')->flagTranslation($message);

        return new Response($saved ? 'OK' : 'ERROR');
    }
@param Request $request
@param string  $token

@Route("/{token}/translation/flag", name="_profiler_translations_flag")
@Method("POST")

@return Response