コード例 #1
0
 public function voteAction()
 {
     $this->view->layout()->disableLayout();
     $votesModel = new Application_Model_Votes();
     $page = $this->getRequest()->getParam('page', 'index:index');
     $value = $this->getRequest()->getParam('value', 5);
     $votesModel->addVote($value, $page, $_SERVER['REMOTE_ADDR']);
     $this->view->votedata = $votesModel->getVote($page);
 }
コード例 #2
0
 /**
  * 
  */
 public function votedata()
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     $sub = $request->getParam('name', '') . $request->getParam('id', '');
     $page = $controller . ':' . $action . ':' . $sub;
     $votesModel = new Application_Model_Votes();
     $vote = $votesModel->getVote($page);
     return $vote;
 }