From 72e930e0c1eab173cff6e25e46eba80f0e6c103a Mon Sep 17 00:00:00 2001 From: bscheshirwork Date: Fri, 19 Oct 2018 16:39:50 +0300 Subject: [PATCH 1/2] Add set flash to example for more complex view --- docs/enhancing-and-overriding/overriding-controllers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/enhancing-and-overriding/overriding-controllers.md b/docs/enhancing-and-overriding/overriding-controllers.md index 186c7c2..1ba1c98 100644 --- a/docs/enhancing-and-overriding/overriding-controllers.md +++ b/docs/enhancing-and-overriding/overriding-controllers.md @@ -20,6 +20,7 @@ Please, before you override a controller's action, make sure that it won't be en 'on ' . \Da\User\Event\ResetPasswordEvent::EVENT_AFTER_RESET => function (\Da\User\Event\ResetPasswordEvent $event) { if ($event->token->user ?? false) { \Yii::$app->user->login($event->token->user); + \Yii::$app->session->setFlash('success', Yii::t('usuario', 'Password has been changed')); } \Yii::$app->controller->redirect(\Yii::$app->getUser()->getReturnUrl()); \Yii::$app->end(); From c0390338173b4b90d2114a7c29d5b3c1216ffcf6 Mon Sep 17 00:00:00 2001 From: bscheshirwork Date: Fri, 19 Oct 2018 17:50:55 +0300 Subject: [PATCH 2/2] Add another flash to example for more complex view --- docs/enhancing-and-overriding/overriding-controllers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/enhancing-and-overriding/overriding-controllers.md b/docs/enhancing-and-overriding/overriding-controllers.md index 1ba1c98..7dfc8f6 100644 --- a/docs/enhancing-and-overriding/overriding-controllers.md +++ b/docs/enhancing-and-overriding/overriding-controllers.md @@ -33,6 +33,7 @@ Please, before you override a controller's action, make sure that it won't be en \Yii::$app->end(); }, 'on ' . \Da\User\Event\FormEvent::EVENT_AFTER_RESEND => function (\Da\User\Event\FormEvent $event) { + \Yii::$app->session->setFlash('info', Yii::t('usuario', 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.')); \Yii::$app->controller->redirect(['/user/security/login']); \Yii::$app->end(); },