render('index', [ 'user' => $this->getUserCurrent(), 'producer' => $this->getProducerCurrent() ]); } public function actionSubscribe() { $userManager = $this->getUserManager(); $userCurrent = $this->getUserCurrent(); $userManager->subscribeUserNewsletter($userCurrent); $this->setFlash('success', "Votre inscription au bulletin d'information a bien été prise en compte."); return $this->redirect('index'); } public function actionUnsubscribe() { $userManager = $this->getUserManager(); $userCurrent = $this->getUserCurrent(); $userManager->unsubscribeUserNewsletter($userCurrent); $this->setFlash('success', "À partir de maintenant, vous ne recevrez plus d'email de la part de ce producteur."); return $this->redirect('index'); } } ?>