public function addAction() { if ($this->_request->getParam("body")) { $comment_model = new Application_Model_Comment(); $comment_info = ["body" => $this->_request->getParam("body"), "threadId" => $this->_request->getParam("threadId"), "userId" => Zend_Auth::getInstance()->getStorage()->read()->id]; $id = $comment_model->addComment($comment_info); echo $id; exit; } }
public function addAction() { $this->view->post_data = $this->_request->getParams(); if ($this->_request->isPost()) { $post_data = $this->_request->getParams(); var_dump($post_data); echo $post_data['commentbody']; if (!empty($post_data['commentbody'])) { var_dump($post_data); $comment = new Application_Model_Comment(); $comment->addComment($post_data); } else { $post = new Application_Model_Post(); $this->view->post_id = $post->addPost($post_data); $this->view->post_data = $this->_request->getParams(); } } }