public function admin() { if (!isset($_SESSION['authenticated']) || !$_SESSION['authenticated']) { $this->app->redirect($this->app->urlFor('login')); return; } if ($this->app->request->isGet()) { $params = array_merge($this->getView(), array('themes' => $this->themeService->getThemes())); $this->app->render($this->themeService->getTemplate('admin.html.twig'), $params); return; } else { if ($this->app->request->isPost()) { $data = array(); parse_str($this->app->request->getBody(), $data); try { $this->settingRepository->save($data); $this->app->flash('save_success', 'Settings saved successfully.'); } catch (PaytoshiException $e) { $this->app->flash('save_error', 'Cannot save settings.'); } $this->app->response->redirect($this->app->urlFor('admin')); return; } } }
public function faq() { $this->app->render($this->themeService->getTemplate('faq.html.twig'), $this->getTemplateData()); }