public function indexAction($url) { $dbPage = new Wsm_Db_Page(); $page = $dbPage->getByUrl($url); if ($page == null) { throw new Exception('404 Not Found'); } $this->setTitle($page->getTitle()); $this->setContent($page->getContent()); }
public function saveAction() { if ($this->has('id')) { $page = new Wsm_Page(); $page->setId($this->get('id')); $page->setTitle($this->get('title')); $page->setContent($this->get('content')); $pageDb = new Wsm_Db_Page(); try { $pageDb->save($page); $this->redirect('pages/index?msg=saved'); } catch (Exception $e) { } } $this->redirect('pages/index?msg=save_error'); }