Beispiel #1
0
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"
}
Beispiel #2
0
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"
}
Beispiel #3
0
func (this *ArticleController) Get() {
	articleCategory := new(models.Articlecategory)
	categories := articleCategory.GetList()
	this.Data["categories"] = categories
	this.TplNames = "admin/article.tpl"
}
Beispiel #4
0
func (this *ArtilcecategoryController) GetDataList() {
	articleCategory := new(models.Articlecategory)
	categories := articleCategory.GetList()
	this.Data["json"] = categories
	this.ServeJson()
}