Example #1
0
func CustomSetting(context *GoInk.Context) {
	if context.Method == "POST" {
		keys := context.Strings("key")
		values := context.Strings("value")
		for i, k := range keys {
			model.SetSetting("c_"+k, values[i])
		}
		model.SyncSettings()
		Json(context, true).End()
		return
	}
	context.Layout("admin")
	context.Render("admin/custom_setting", map[string]interface{}{
		"Title":    "自定义配置",
		"Settings": model.GetCustomSettings(),
	})
}