示例#1
0
 public function postDispatch(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response)
 {
     //disableView or return false in controller or empty template file will lead response body eq ''
     if (isset($response->layout) && !empty($response->getBody())) {
         $response->setBody(call_user_func($response->layout, $response->getBody()));
     }
 }
示例#2
0
 public function dispatchLoopShutdown(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response)
 {
     if ($response->getBody() !== '') {
         echo $response->getBody();
     }
     $response->setBody(ob_get_clean());
 }