Yii Framework Forum: Flash Data Not work. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Flash Data Not work. Setflash not set data Rate Topic: -----

#1 User is offline   rrbala123 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 19-December 14

Posted 14 August 2015 - 02:05 AM

Hi,

Its working in chrome not working in firefox Why?

Cant Set flash Data in my Site,

In My controller,

if($model->save())
{
Yii::app()->user->setFlash('success', 'Your Message Send Successfully..'); //Set flash Data

$this->redirect(array('view'));
}


In my view Page:

I get flash Data:

foreach (Yii::app()->user->getFlashes() as $key => $message) {
echo '<div class="alert alert-' . $key . ' "><a href="#" class="close" data-dismiss="alert">&times;</a>' . $message . "</div>";
}

But Cant get flash data,and also try like these,

<?php if(Yii::app()->user->hasFlash('success')){?>
<div class="alert alert-success">
<?php echo Yii::app()->user->getFlash('success'); ?>
</div>
<?php }

?>

But this code also not working please give me solution for my issue.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users