add missing deleteflash method
This commit is contained in:
parent
f7d344d3e0
commit
32116905b7
4
forms.go
4
forms.go
@ -101,10 +101,10 @@ func (f FormValue) IsEmpty() bool {
|
||||
// GetFormArray gets multiple form values as string slice
|
||||
func (ctx Ctx) GetFormArray(key string) []string {
|
||||
var values []string
|
||||
ctx.PostArgs().VisitAll(func(k, v []byte) {
|
||||
for k, v := range ctx.PostArgs().All() {
|
||||
if string(k) == key {
|
||||
values = append(values, string(v))
|
||||
}
|
||||
})
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
@ -104,6 +104,10 @@ func (s *Session) GetFlash(key string) (any, bool) {
|
||||
return value, exists
|
||||
}
|
||||
|
||||
func (s *Session) DeleteFlash(key string) {
|
||||
s.Delete("flash_" + key)
|
||||
}
|
||||
|
||||
func (s *Session) GetFlashMessage(key string) string {
|
||||
if flash, exists := s.GetFlash(key); exists {
|
||||
if msg, ok := flash.(string); ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user