/** * 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; }
/** * 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(); }