Revision #4 has been created by qiang on Apr 12, 2011, 1:10:03 AM with the memo:
« previous (#3)
An easy way to display a success page using flash messages
flash message, Forms
[...]* First, instead of saving a string as flash message, we save an array of data that will persist to the next page request.
* Second, we use the action code to control which view to render. The code conforms better to the MVC pattern.
## Refactoring the code
If an application needs to display different success pages in different actions, we may refactor the above code so that the usage is even simpler and more DRY.
First in the [base controller class](http://www.yiiframework.com/wiki/121/extending-common-classes-to-allow-better-customization), define the following method: