findOneBySlug(self::HOME_SLUG); if ($this->notFound($page)) { $this->app->redirect('404'); } $this->render($page); } /** * get single page from slug * * * @param string $slug */ public function getAction($slug) { $repository = Manager::get('Page'); $page = $repository->findOneBySlug($slug); if ($this->notFound($page)) { $this->app->redirect('404'); } $this->render($page); } /** * if page not found * */ public function notFoundAction() { $page = [ 'data' => [ 'view' => 'page/404' ] ]; $this->render($page); } }