/** * ������ �� ���� ������ ������ * @return $this */ public function find() { $this->_model = QuizModel::find($this->_quizId); $this->_question = $this->_model->question(); $answers = $this->_model->answers()->get(); // �������� ����� ���������� ������� $this->_totalResponses = $this->_model->total_responses; foreach ($answers as $a) { $this->_answers[$a->id]['title'] = $a->title(); $this->_answers[$a->id]['count'] = $a->responses_count; $this->_answers[$a->id]['percent'] = $this->getPercent($a->responses_count); } return $this; }
public function anyIndex() { // todo: CORRECT $item = \QuizModel::find(1); $this->layout->content = View::make('back/quiz/list')->with('item', $item); }