astaxie/

directory
v0.0.0-...-09a6eee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2016 License: GPL-2.0

Directories

Path Synopsis
beego
utils/captcha
an example for use captcha “` package controllers import ( "github.com/astaxie/beego" "github.com/astaxie/beego/cache" "github.com/astaxie/beego/utils/captcha" ) var cpt *captcha.Captcha func init() { // use beego cache system store the captcha data store := cache.NewMemoryCache() cpt = captcha.NewWithFilter("/captcha/", store) } type MainController struct { beego.Controller } func (this *MainController) Get() { this.TplNames = "index.tpl" } func (this *MainController) Post() { this.TplNames = "index.tpl" this.Data["Success"] = cpt.VerifyReq(this.Ctx.Request) } “` template usage “` {{.Success}} <form action="/" method="post"> {{create_captcha}} <input name="captcha" type="text"> </form> “` modifiy and integrated to Beego from https://github.com/dchest/captcha modifiy and integrated to Beego from https://github.com/dchest/captcha
an example for use captcha “` package controllers import ( "github.com/astaxie/beego" "github.com/astaxie/beego/cache" "github.com/astaxie/beego/utils/captcha" ) var cpt *captcha.Captcha func init() { // use beego cache system store the captcha data store := cache.NewMemoryCache() cpt = captcha.NewWithFilter("/captcha/", store) } type MainController struct { beego.Controller } func (this *MainController) Get() { this.TplNames = "index.tpl" } func (this *MainController) Post() { this.TplNames = "index.tpl" this.Data["Success"] = cpt.VerifyReq(this.Ctx.Request) } “` template usage “` {{.Success}} <form action="/" method="post"> {{create_captcha}} <input name="captcha" type="text"> </form> “` modifiy and integrated to Beego from https://github.com/dchest/captcha modifiy and integrated to Beego from https://github.com/dchest/captcha

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL