Modification of product classification
Modification of product categories
The principle of modifying product categories is the same as that of members.
CateController.class.php
public function edit(){ $cate=D('cate'); if (IS_POST) { if($cate->create()){ if ($cate->save()!== false) { $this->success('修改商品分类成功',U('index')); }else{ $this->error('修改商品分类失败!'); } }else{ $this->error($cate->getError()); } return; } $cates=$cate->find(I('id')); $cateres=$cate->catetree(); $this->assign('cateres',$cateres); $this->assign('cates',$cates); $this->display(); }
After accepting the parameters, perform verification.
$cates=$cate->find(I('id')); $cateres=$cate->catetree(); $this->assign('cateres',$cateres);
Get the sent id and then generate a classification tree.
Assign data to template
PHP中文网
The editing interface is completed