예제 #1
0
파일: Application.php 프로젝트: dgilan/test
 /**
  * Injects particular page content into the main layout and sends it as response
  *
  * @param string $content
  */
 private static function _sendResponse($content)
 {
     $renderer = new Renderer(APP_PATH . '/layout.html.php');
     $renderer->assign(array('content' => $content, 'user' => Token::getUser(), 'route' => Router::getInstance()->getRoute()));
     $response = $renderer->render();
     Connection::getInstance()->disconnect();
     echo $response;
     Token::set('flush', null);
     exit;
 }
예제 #2
0
 /**
  * Renders view
  *
  * @param string $view
  * @param array  $data Data to be assigned to the view
  *
  * @return string
  */
 protected function _renderView($view, $data = array())
 {
     $render = new Renderer($this->_getViewPath($view));
     $render->assign($data);
     return $render->render();
 }