private function getVote() { $_vote = new VoteModel(); $_sum = $_vote->getVoteSum()->c; $_width = 400; $this->_tpl->assign('vote_title', $_vote->getVoteTitle()->title); $this->_tpl->assign('width', $_width); $_object = $_vote->getVoteItem(); if ($_object) { $_i = 1; foreach ($_object as $_value) { $_value->percent = round($_value->count / $_sum * 100, 2) . '%'; $_value->picwidth = $_value->count / $_sum * $_width; $_value->picnum = $_i; $_i++; } } $this->_tpl->assign('vote_item', $_object); }
private function getVote() { $_vote = new VoteModel(); $this->_tpl->assign('vote_title', $_vote->getVoteTitle()->title); $this->_tpl->assign('vote_item', $_vote->getVoteItem()); }