コード例 #1
0
 public function create($survey_id = null, $question_id = null)
 {
     $this->tinymce = true;
     $survey = self::load_survey($survey_id);
     $question = self::load_question($survey, $question_id);
     $option = new SurveyQuestionOption();
     $option->question = $question;
     $option->survey_question_id = $question->id;
     if ($this->post) {
         $option->value = $this->PostData("value");
         if ($option->Save()) {
             Site::Flash("notice", "The option has been created");
             Redirect("admin/surveys/{$survey->id}/questions/{$question->id}#options");
         }
     }
     $this->assign("survey", $survey);
     $this->assign("question", $question);
     $this->assign("option", $option);
     $this->title = "New Option";
     $this->render("survey_question_option/create.tpl");
 }