コード例 #1
0
 public function commentAction()
 {
     $guest_id = $this->_getParam("guest_id");
     $guestbook = new Application_Model_GuestbookMapper();
     $guest = new Application_Model_Guestbook();
     $this->view->guest = $guestbook->find($guest_id, $guest);
     $this->view->title = "Comment";
 }
コード例 #2
0
 public function deleteAction()
 {
     $blog_id = $this->getRequest()->getParam('id');
     if ($blog_id) {
         $mapper = new Application_Model_GuestbookMapper();
         $mapper->delete($blog_id);
     }
     $this->_helper->flashMessenger->addMessage('Deleted');
     return $this->_helper->redirector('index');
 }
コード例 #3
0
 public function signAction()
 {
     $request = $this->getRequest();
     $form = new Application_Form_Guestbook();
     if ($request->isPost() && $form->isValid($request->getPost())) {
         $comment = new Application_Model_Guestbook($form->getValues());
         $mapper = new Application_Model_GuestbookMapper();
         $mapper->save($comment);
         return $this->_helper->redirector('index');
     }
     $this->view->form = $form;
 }
コード例 #4
0
ファイル: GuestbookController.php プロジェクト: rvv/zendstart
 public function indexAction()
 {
     $guestbook = new Application_Model_GuestbookMapper();
     $this->view->entries = $guestbook->fetchAll();
 }