public function send($result) { if (!$result) { $result = array(); } $type = $this->request->type; if ($type == 'json') { return $this->sendJson($result); } if ($type == 'html' || $type == 'ajax') { $layout = Registry::get('app')->layout; $view = new View(); $view->setData($result); $content = $view->render('modules/' . $this->request->module . '/views/' . $this->request->controller . '/' . $this->request->action); if ($layout->isLayout()) { $layout->content = $content; $content = $layout->render(); } echo $content; return $content; } return null; }
public function partial($path, $data = array()) { $view = new View(); $view->setData($data); return $view->render($path); }