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"; }
public function signAction() { $request = $this->getRequest(); $form = new Application_Form_Guestbook(); $mapper = new Application_Model_GuestbookMapper(); $blog_id = $this->getRequest()->getParam('id'); if ($blog_id) { $formData = $mapper->find($blog_id); $form->populate($formData); } if ($this->getRequest()->isPost()) { if ($form->isValid($request->getPost())) { $comment = new Application_Model_Guestbook($form->getValues()); $mapper->save($comment); $this->_helper->flashMessenger->addMessage('Saved'); return $this->_helper->redirector('index'); } } $this->view->form = $form; }
public function postAction() { $postId = $request->getParam('id'); $guestbook = new Application_Model_GuestbookMapper(); $this->view->entries = $guestbook->find($postId); }