显示信息提示用户时,可以用setFlashhasFlashgetFlash

function actionOk()
{
        Yii::app()->user->setFlash('success', 'Everything went fine!');
        $this->redirect('index');
}
 function actionBad()
{
        Yii::app()->user->setFlash('error', 'Everything went wrong!');
        $this->redirect('index');
}

 提示的隐藏

views中添加

<?php
$js = <<<JS
    $(function(){
        $(".alert").animate({opacity: 1.0}, 1000).fadeOut("slow");
JS;
$this->registerJs($js);
?>

 

相关文章:

  • 2022-12-23
  • 2021-07-29
  • 2021-08-29
  • 2021-05-26
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
猜你喜欢
  • 2021-11-29
  • 2021-12-16
  • 2021-12-19
  • 2022-12-23
  • 2021-07-02
  • 2021-11-03
相关资源
相似解决方案