Ejemplo n.º 1
0
// 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()
}
Ejemplo n.º 2
0
// 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
}