예제 #1
0
 /**
  * send the content
  *
  * @param string $content
  * @param Request $request
  */
 private function sendContentString($content = '', Request $request)
 {
     $response = $request->getResponse();
     $response->setContent($content);
     $response->send();
 }
예제 #2
0
 /**
  * Handler the controller returned value
  *
  * @param ViewExecuteInterface|Response|Request|string $response
  * @return string|bool
  */
 private function handleResponse($response)
 {
     if ($response instanceof View) {
         $content = $response->render();
     } elseif ($response instanceof Response) {
         $content = $response->getContent();
     } elseif ($response instanceof Request) {
         $content = $response->getResponse()->getContent();
     } elseif (is_string($response)) {
         $content = $response;
     } else {
         $content = false;
     }
     return $content;
 }