本文整理汇总了Golang中gocms/models.Articlecategory.GetList方法的典型用法代码示例。如果您正苦于以下问题:Golang Articlecategory.GetList方法的具体用法?Golang Articlecategory.GetList怎么用?Golang Articlecategory.GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gocms/models.Articlecategory
的用法示例。
在下文中一共展示了Articlecategory.GetList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Edit
func (this *ArticleController) Edit() {
id := this.Ctx.Input.Param(":id")
articleCategory := new(models.Articlecategory)
categories := articleCategory.GetList()
this.Data["id"] = id
this.Data["categories"] = categories
this.TplNames = "admin/articleEdit.tpl"
}
示例2: Edit
func (this *ArtilcecategoryController) Edit() {
id := this.Ctx.Input.Param(":id")
articleCategory := new(models.Articlecategory)
if strings.Compare(id, "") == 0 {
this.Data["categories"] = articleCategory.GetList()
} else {
categoryId, err := strconv.Atoi(id)
if err != nil {
fmt.Println(err)
}
categories := articleCategory.GetListEncludesSelf(categoryId)
fmt.Println(categories)
this.Data["categories"] = categories
}
this.Data["id"] = id
this.TplNames = "admin/articleCategoryEdit.tpl"
}
示例3: Get
func (this *ArticleController) Get() {
articleCategory := new(models.Articlecategory)
categories := articleCategory.GetList()
this.Data["categories"] = categories
this.TplNames = "admin/article.tpl"
}
示例4: GetDataList
func (this *ArtilcecategoryController) GetDataList() {
articleCategory := new(models.Articlecategory)
categories := articleCategory.GetList()
this.Data["json"] = categories
this.ServeJson()
}