Exemple #1
0
func (form *TopicAdminForm) CategorySelectData() [][]string {
	var cats []models.Category
	models.FindCategories(&cats)
	data := make([][]string, 0, len(cats))
	for _, cat := range cats {
		data = append(data, []string{cat.Name, utils.ToStr(cat.Id)})
	}
	return data
}
Exemple #2
0
//Get all the categories
func (this *PostListRouter) setCategories(cats *[]models.Category) {
	models.FindCategories(cats)
	this.Data["Categories"] = *cats
}