Yii Framework Forum: is it a bug or just me: flash message / redirect / CWebLogRoute - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

is it a bug or just me: flash message / redirect / CWebLogRoute Rate Topic: -----

#1 User is offline   muayyad alsadi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 27-April 11

Posted 06 June 2012 - 08:06 AM

I've set a flash with

Yii::app()->user->setFlash('flash', array('status' => 'error', 'message' => 'failed'));

then redirect with

$this->redirect('/');

but I can't see the flash message knowing that I've rendered the flash partial

but site/index action redirect to /me/ and profiling is enabled

flash is seen on other pages that does not redirect, flash is also seen (I guess) when I disable CWebLogRoute

did I miss something ? or is there a bug somewhere ?

is it something in Yii::app()->end(); called by the redirect ?
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 358
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 06 June 2012 - 10:53 AM

Yep, you missed something ;-)
Set
autoUpdateFlash
to false to have flash messages valid over one or more redirects:
http://www.yiiframew...ateFlash-detail

I don't think the default behavior is what one would expect, but it is defualt true for backwards compatibility.
1

#3 User is offline   muayyad alsadi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 27-April 11

Posted 29 July 2012 - 07:09 AM

thank you very much, is there any expected side effects ?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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