/** * Handles string responses. * * Handler for onKernelView. */ public function onKernelView(GetResponseForControllerResultEvent $event) { $response = $event->getControllerResult(); $converter = new StringResponseConverter(); $event->setResponse($converter->convert($response)); }
public function setStringResponse($response) { $converter = new StringResponseConverter(); $this->setResponse($converter->convert($response)); }