Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class GuestbookController extends Zend_Controller_Action
- {
- public function indexAction()
- {
- $guestbook = new Application_Model_GuestbookMapper();
- $this->view->entries = $guestbook->fetchAll();
- }
- public function signAction()
- {
- $request = $this->getRequest();
- $form = new Application_Form_Guestbook();
- if ($this->getRequest()->isPost()) {
- if ($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;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement