예제 #1
0
파일: All.php 프로젝트: jacksleight/chalk
 public function postDispatch(Request $req, Response $res)
 {
     $config = $this->chalk->config->viewScripts;
     $path = "{$config[0]}/{$req->group}/{$req->controller}/{$req->action}";
     $params = (array) $req->view + ['req' => $req, 'res' => $res];
     return $res->html($this->view->render($path, $params, $config[1]));
 }
예제 #2
0
파일: View.php 프로젝트: jacksleight/coast
 public function execute(\Coast\Request $req, \Coast\Response $res)
 {
     $path = $req->path();
     $path = '/' . (strlen($path) ? $path : 'index');
     $files = $this->files($this->script($path));
     if (!count($files)) {
         return;
     }
     return $res->html($this->render($path, ['req' => $req, 'res' => $res]));
 }