Answer the question
In order to leave comments, you need to log in
Sessions and how to display them?
The problem is that after password recovery (entering a new password), I am redirected to the authorization page, on which it is necessary to display a message that the password has been changed. I'm trying to do it like this:
<?= Yii::$app->session->setFlash('success', 'Password Changed.'); ?>
$session->getFlash('success');
Answer the question
In order to leave comments, you need to log in
Good afternoon.
In the controller
In
Or viewecho Yii::$app->session->getFlash('success');
slo_nik and Maxim Fedorov wrote everything correctly, I’ll add that, for example, I use alertifyjs.com instead of the standard one for output<?= Alert::widget(); ?>
But the message is not displayed.
I print out the session, everything is there, but stubbornly does not want to be displayed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question