代码拉取完成,页面将自动刷新
package routes
import (
"github.com/teamlint/iris/sessions"
"github.com/teamlint/iris"
)
// Index will increment a simple int version based on the visits that this user/session did.
func Index(ctx iris.Context, session *sessions.Session) {
// it increments a "visits" value of integer by one,
// if the entry with key 'visits' doesn't exist it will create it for you.
visits := session.Increment("visits", 1)
// write the current, updated visits.
ctx.Writef("%d visit(s) from my current session", visits)
}
/*
You can also do anything that an MVC function can, i.e:
func Index(ctx iris.Context,session *sessions.Session) string {
visits := session.Increment("visits", 1)
return fmt.Spritnf("%d visit(s) from my current session", visits)
}
// you can also omit iris.Context input parameter and use dependency injection for LoginForm and etc. <- look the mvc examples.
*/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。