public function showWotd() { $this->allowTo('admin'); $termManager = new \Manager\TermManager(); $wotd = $termManager->getCurrentWordOfTheDay(); $this->show('term/show_wotd', ['wotd' => $wotd]); }
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'); }
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'); }
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'); }