From 67b836164997527b91452b19adbcb8aa3c5decf1 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 May 2016 18:31:47 -0400 Subject: Refactoring: added controlled middleware and changed response class --- app/Controller/AppController.php | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 app/Controller/AppController.php (limited to 'app/Controller/AppController.php') diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php new file mode 100644 index 00000000..60bc154a --- /dev/null +++ b/app/Controller/AppController.php @@ -0,0 +1,45 @@ +request->isAjax()) { + $this->response->json(array('message' => 'Access Forbidden'), 403); + } + + $this->response->html($this->helper->layout->app('app/forbidden', array( + 'title' => t('Access Forbidden'), + 'no_layout' => $withoutLayout, + ))); + } + + /** + * Page not found + * + * @access public + * @param boolean $withoutLayout + */ + public function notFound($withoutLayout = false) + { + $this->response->html($this->helper->layout->app('app/notfound', array( + 'title' => t('Page not found'), + 'no_layout' => $withoutLayout, + ))); + } +} -- cgit v1.2.3