<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//控制器创建对象,执行逻辑代码各个功能
class ProductsController{
public function listAction(){
$model=new ProductsModel();
$rs=$model->getlist();
require __VIEW__.'showList.html';
}
public function delAction(){
$id=$_GET['id'];
$model=new ProductsModel();
if($model->delproducts($id))
$this->success('index.php?p=Admin&c=Products&a=list','删除成功');
else{
$this->error('index.php?p=Admin&c=Productds&a=list','删除失败');
}
}
}
?>
|