func (this *ProductController) UiList() { item := s.Product oItemDef, _ := itemDef.EntityDefMap[item] this.Data["listUrl"] = "/item/product/list" this.Data["addUrl"] = "ui/product/add" this.Data["updateUrl"] = "ui/product/update" this.Data["thlist"] = ui.BuildListThs(oItemDef) this.TplNames = "product/list.tpl" }
func (this *UserController) UiList() { item := "user" oItemDef, _ := itemDef.EntityDefMap[item] this.Data["listUrl"] = fmt.Sprintf("/item/list/%s", item) this.Data["addUrl"] = fmt.Sprintf("/ui/add/%s", item) this.Data["updateUrl"] = fmt.Sprintf("/ui/update/%s", item) this.Data["thlist"] = ui.BuildListThs(oItemDef) this.TplNames = "user/list.tpl" }
func (this *UiController) List() { item, ok := this.Ctx.Input.Params[":hi"] if !ok { beego.Error(stat.ParamItemError) this.Ctx.WriteString(stat.ParamItemError) return } oItemDef, ok := itemDef.EntityDefMap[item] if !ok { beego.Error(fmt.Sprintf("Item %s not define", item)) this.Ctx.WriteString(stat.ItemNotDefine) return } this.Data["item"] = item this.Data["listUrl"] = fmt.Sprintf("/item/list/%s", item) this.Data["addUrl"] = fmt.Sprintf("/ui/add/%s", item) this.Data["updateUrl"] = fmt.Sprintf("/ui/update/%s", item) this.Data["thlist"] = ui.BuildListThs(oItemDef) this.TplNames = "item/list.tpl" }