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 }
//Get all the categories func (this *PostListRouter) setCategories(cats *[]models.Category) { models.FindCategories(cats) this.Data["Categories"] = *cats }