flash messages

October 4, 2010

Automated display of flash messages

Step 1. Put this method into your WebUser class: public function getFlashKeys ( ) { $counters=$this->getState(self::FLASH_COUNTERS); if(empty($counters)) return array(); return array_keys($counters); }  
September 22, 2010

Working with flash messages in Yii

If you would like to inform the user, that his changes were successfully saved, you could add the following line to your Controller: Yii::app()->user->setFlash('success',"Data saved!");   Displaying the flash message in a view is done by if( Yii::app()->user->hasFlash('success') ) { […]
gdpr-image
This website uses cookies to provide necessary website functionality, improve your experience and analyze our traffic. By using our website, you agree to our Privacy Policy and our cookies usage.
READ MORE