public function addadmirationAction() { $this->_helper->viewRenderer->setNoRender(true); if ($this->auth->hasIdentity()) { $postadmire = new Application_Model_Admiration($this->registry['DB']); $userid = $this->getRequest()->getParam('userid'); $text = $this->getRequest()->getParam('text'); echo json_encode($postadmire->addAdmiration($userid, $text)); } else { echo json_encode(array('status' => 'error')); } }