示例#1
0
 public function showWotd()
 {
     $this->allowTo('admin');
     $termManager = new \Manager\TermManager();
     $wotd = $termManager->getCurrentWordOfTheDay();
     $this->show('term/show_wotd', ['wotd' => $wotd]);
 }
示例#2
0
 public function changeWotd($id)
 {
     $termManager = new \Manager\TermManager();
     $wotd = $termManager->getCurrentWordOfTheDay();
     debug($wotd);
     $termManager->update(['is_wotd' => 0], $wotd['id']);
     $termManager->update(['is_wotd' => 1], $id);
     $this->redirectToRoute('show_all_terms');
 }
示例#3
0
 public function change_Wotd($id)
 {
     $termManager = new \Manager\TermManager();
     $wotd = $termManager->getCurrentWordOfTheDay();
     // $Wotd = termManager->getRandomWord();
     $termManager->update(["is_wotd" => 0], $wotd['id']);
     $termManager->update(["is_wotd" => 1], $id);
     $this->redirectToRoute('show_all_terms');
 }
示例#4
0
 public function changeWotd($id)
 {
     $termManager = new \Manager\TermManager();
     //sélectionner le mot du jour actuel
     $wotd = $termManager->getCurrentWordOfTheDay();
     //faire un update sur l'ancien mot du jour pour le mettre à 0
     $termManager->update(["is_wotd" => 0], $wotd['id']);
     //faire un update sur le nouveau terme pour le mettre à 1
     $termManager->update(["is_wotd" => 1], $id);
     //rediriger vers la page d'accueil
     $this->redirectToRoute('show_all_terms');
 }