コード例 #1
0
ファイル: focuscate.go プロジェクト: blackmady/GoCMS
func (c FocusCate) Index(focusCate *models.FocusCate) revel.Result {

	title := "焦点图分类--GoCMS管理系统"

	var page string = c.Params.Get("page")

	if len(page) > 0 {
		Page, err := strconv.ParseInt(page, 10, 64)
		if err != nil {
			revel.WARN.Println(err)
		}

		focusCate_list, pages := focusCate.GetByAll(Page, 10)

		c.Render(title, focusCate_list, pages)
	} else {
		focusCate_list, pages := focusCate.GetByAll(1, 10)

		c.Render(title, focusCate_list, pages)
	}

	return c.RenderTemplate("Content/FocusCate/Index.html")
}