? ?? ???? ??
New ?? ???? ewcatecontroller.class.php controller
<?php namespace Admin\Controller; use Think\Controller; class CateController extends CommonController { public function index(){ $this->display(); } public function add(){ $cate=D('Cate'); if (IS_POST) { if($cate->create()){ if ($cate->add()) { $this->success('添加商品分類成功',U('Cate/add')); }else{ $this->error('添加商品分類失敗!'); } }else{ $this->error($cate->getError()); } return; } $cateres=$cate->select(); $this->assign('cateres',$cateres); $this->display(); } }
commoncontroller? ??? ??? ?? ? ?? ????? ?? ?????.
CateModel.class.php
$cateres=$cate->select();
$this->assign('cateres',$cateres);
???? ?? ??
??? ???? ?? ??