write() public method

Proxies to the underlying stream and writes the provided data to it.
public write ( string $data )
$data string
 /**
  * Ping action.
  *
  * @param ServerRequestInterface $request
  * @param ResponseInterface $response
  * @return string
  */
 public function ping(ServerRequestInterface $request, ResponseInterface $response)
 {
     $data = ['ack' => time(), 'target' => __METHOD__];
     $response->write($this->json->render($data));
     return $this->json->response($response);
 }
 /**
  * Show user.
  *
  * @param ServerRequestInterface $request
  * @param ResponseInterface $response
  * @return \Psr\Http\Message\MessageInterface
  */
 public function user(ServerRequestInterface $request, ResponseInterface $response)
 {
     $response->write($this->json->render($this->user->toArray()));
     return $this->json->response($response);
 }
 /**
  * Index action.
  *
  * @param ServerRequestInterface $request
  * @param ResponseInterface $response
  * @return int
  */
 public function home(ServerRequestInterface $request, ResponseInterface $response)
 {
     $data = ['routerName' => 'FastRoute', 'routerDocs' => 'https://github.com/nikic/FastRoute', 'templateName' => 'Twig', 'templateDocs' => 'http://twig.sensiolabs.org/documentation'];
     $response->write($this->template->render('app::index', $data));
     return $response;
 }