Yii prompt message to the user

Yii::$app- > getSession ()-> setFlash ("success", "saved successfully!") ; use this method to prompt information to the user, prompt a quick message, please ask how to set the time, let the prompt disappear after how long, if this prompt can not be realized, please ask, is there any other way to implement yii, thank you

Mar.06,2021

this just sets the message to session and deletes it once. It doesn't show up on the page.
look at the rendering layer file


<?php
    \Yii::app()->clientScript->registerScript(
        'myHideEffect',
        '$(".info").animate({opacity: 1.0}, 3000).fadeOut("slow");',
        CClientScript::POS_READY
    );
?>

usually use js to write a timer to disappear, find the part of the prompt box, and modify the disappearance time.


finally delay fade out
$(".fade"). Delay (5000). FadeOut ("slow") by finding the class of fade;

Menu