add NewFlash func

This commit is contained in:
astaxie 2013-08-03 18:17:00 +08:00
parent 0c2af58b8d
commit 5b3b6f7f48
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,12 @@ type FlashData struct {
Data map[string]string
}
func NewFlash() *FlashData{
return &FlashData{
Data:make(map[string]string)
}
}
func (fd *FlashData) Notice(msg string, args ...interface{}) {
if len(args) == 0 {
fd.Data["notice"] = msg