/** * Run the Application */ public function run() { try { $this->startSession(); $this->initConfig(); $this->dispatch(); } catch (Exception $e) { Debug::catchException($e); exit(1); } catch (\Exception $e) { Debug::catchNormalException($e); exit(1); } }
/** * render a page without layout * @param string|null $view * @param array $data */ public function renderPartial($view = null, array $data = []) { extract($data); $viewFile = $this->parseView($view); try { if (file_exists($viewFile)) { include $viewFile; } else { header('HTTP/1.1 500 Internal Server Error'); throw new Exception('View Not Found', 'View ' . $viewFile . ' not exists!' . PHP_EOL); } } catch (Exception $e) { Debug::catchException($e); } }