Exemplo n.º 1
0
 public function addAction($question_id)
 {
     $this->view->poll = Questions::findFirst($question_id);
     if ($this->request->isPost()) {
         $option = new Options();
         $option->question_id = $question_id;
         $option->option_name = $this->request->getPost('name');
         $option->vote = 0;
         $option->save();
         return $this->dispatcher->forward(array('action' => 'show', 'params' => array($question_id)));
     }
 }