コード例 #1
0
ファイル: index.go プロジェクト: seacoastboy/gowalker
// Get implemented Get method for IndexRouter.
func (this *IndexRouter) Get() {
	this.Data["IsIndex"] = true
	// Set language version.
	curLang := setLangVer(this.Ctx, this.Input(), this.Data)

	// Set properties
	this.TplNames = "index_" + curLang.Lang + ".html"

	// Get index page data.
	this.Data["ProNum"], this.Data["PopPros"], this.Data["ImportedPros"],
		_ = models.GetIndexPageInfo()
}
コード例 #2
0
ファイル: index.go プロジェクト: hendyyou/gowalker
// Get implemented Get method for IndexController.
// It serves index page of Go Walker.
func (this *IndexController) Get() {
	// Set language version.
	curLang, restLangs := setLangVer(this.Ctx.Request, this.Input())

	// Save language information in cookies.
	this.Ctx.SetCookie("lang", curLang.Lang+";path=/", 0)

	// Set properties
	this.Layout = "layout_" + curLang.Lang + ".html"
	this.TplNames = "index_" + curLang.Lang + ".html"

	// Get index page data.
	this.Data["ProNum"], this.Data["PopPros"], this.Data["ImportedPros"],
		_ = models.GetIndexPageInfo()

	// Set language properties.
	this.Data["Lang"] = curLang.Lang
	this.Data["CurLang"] = curLang.Name
	this.Data["RestLangs"] = restLangs
}