Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
81643677
authored
2014-09-23 23:54:38 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
beego: flash add success & Set
1 parent
e1475b72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
flash.go
flash.go
View file @
8164367
...
...
@@ -32,6 +32,24 @@ func NewFlash() *FlashData {
}
}
// Set message to flash
func
(
fd
*
FlashData
)
Set
(
key
string
,
msg
string
,
args
...
interface
{})
{
if
len
(
args
)
==
0
{
fd
.
Data
[
key
]
=
msg
}
else
{
fd
.
Data
[
key
]
=
fmt
.
Sprintf
(
msg
,
args
...
)
}
}
// Success writes success message to flash.
func
(
fd
*
FlashData
)
Success
(
msg
string
,
args
...
interface
{})
{
if
len
(
args
)
==
0
{
fd
.
Data
[
"success"
]
=
msg
}
else
{
fd
.
Data
[
"success"
]
=
fmt
.
Sprintf
(
msg
,
args
...
)
}
}
// Notice writes notice message to flash.
func
(
fd
*
FlashData
)
Notice
(
msg
string
,
args
...
interface
{})
{
if
len
(
args
)
==
0
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment