Example #1
0
 public function saveAction()
 {
     $news = new Wsm_News();
     if ($this->has('id')) {
         $news->setId($this->get('id'));
     }
     $news->setTitle($this->get('title'));
     $news->setContent($this->get('content'));
     $news->setSignature($this->get('signature'));
     $news->setDate($this->get('date'));
     $newsDb = new Wsm_Db_News();
     try {
         $newsDb->save($news);
         $this->redirect('news/index?msg=saved');
     } catch (Exception $e) {
         $this->redirect('news/index?msg=save_error');
     }
 }