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])); }
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])); }