예제 #1
0
 public function orderBy($orderby)
 {
     $manager = new QuestionManager();
     $manager2 = new TagManager();
     $manager3 = new ProfilManager();
     $questions = $manager->getAllQuestions($orderby);
     $tags = array();
     foreach ($questions as $value) {
         $tags[] = $manager2->getTags($value['id']);
     }
     $profils = $manager3->getAllUsers();
     $this->show('default/home', ['questions' => $questions, 'tags' => $tags, 'profils' => $profils, 'orderby' => $orderby]);
 }
예제 #2
0
 public function newR()
 {
     $manager = new QuestionManager();
     //debug($_POST['reponsearea']);die();
     if (isset($_POST['newreponseform'])) {
         if (!empty($_POST['reponsearea'])) {
             $questions_id = $_POST['id'];
             $message = $_POST['reponsearea'];
             $manager->newReponse($questions_id, $message);
             //debug($questions_id);debug($message);die();
             $this->redirectToRoute('question', ['id' => $questions_id]);
         }
         //else
         //{
         //$errorreponse = 'La réponse ne peut être vide';
         //$this->show('default/question', ['errorreponse' => $errorreponse]);
         //}
     }
 }