コード例 #1
0
 public function commentsAction()
 {
     $request = $this->getRequest();
     $form = new Application_Form_Comments();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($request->getPost())) {
             $comment = new Application_Model_Comments($form->getValues());
             $mapper = new Application_Model_CommentsMapper();
             $mapper->save($comment);
             return $this->_helper->redirector('index');
         }
     }
     $this->view->form = $form;
 }