public function fetch($handler = '', $first = true) { $this->header('Pina-Response: Json'); $this->contentType('text/html'); $app = App::get(); $this->view->assign('params', \Pina\Request::params()); $t = $this->view->fetch('file:' . $handler . '.tpl'); if ($first) { $this->view->assign("content", $t); ResourceManager::mode('layout'); $t = $this->view->fetch('Layout/' . $app . '/' . $this->view->getLayout() . '.tpl'); } return $t; }
public function fetch($handler = '', $first = true) { $this->header('Pina-Response: Json'); $this->contentType('text/html'); if ($first && isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $first = false; } $app = App::get(); $t = $this->view->fetch('Modules/' . $handler . '.tpl'); if ($first) { $this->view->assign("content", $t); ResourceManager::mode('layout'); $t = $this->view->fetch('Layout/' . $app . '/' . $this->view->getLayout() . '.tpl'); } //\Pina\Modules\Core\Language::rewrite($t); return $t; }