搭建商品界面
搭建商品界面
view创建goods文件夹
add.html
PHP中文网
控制器
GoodsController.class.php
count(); $Page = new \Think\Page($count,25); $show = $Page->show(); $list = $goods->order('id')->limit($Page->firstRow.','.$Page->listRows)->select(); $this->assign('list',$list); $this->assign('page',$show); $this->display(); } public function add(){ $this->display(); } public function edit(){ $goods=D('goods'); if(IS_POST){ if($goods->create()){ if($goods->save()){ $this->success('修改品牌成功!',U('index')); }else{ $this->error('修改品牌失败!'); } }else{ $this->error($goods->getError()); } return; } $goodss=$goods->find(I('id')); $this->assign('goodss',$goodss); $this->display(); } public function del(){ if(D('goods')->delete(I('id'))){ $this->success('删除品牌成功!',U('index')); }else{ $this->error('删除品牌失败!'); } } }
暂时把品牌的控制器复制过来更改里面的brand为goods
left.html公共文件
引入ueditor