1、修改模板文件 D:\wamp\www\wish\APP\Admin\View\MsgManage_index.html
12345 | <td>{ $v .id}</td> <td>{ $v .username}</td> <td>{ $v .content|replace_phiz=###}</td> <td>{ $v .time| date = 'y-m-d h:i' ,###}</td> <td><a href= "{:U('Admin/MsgManage/delete', array('id'=>$v['id']))}" >删除</a></td> |
2、修改后台类文件 D:\wamp\www\wish\APP\Admin\Controller\MsgManageController.class.php
增加delete方法
123456789 | Public function delete (){ $id = I( 'id' , '' , 'intval' ); if (M( 'wish' )-> delete ( $id )) { $this ->success( '删除成功。' , U( 'Admin/MsgManage/index' )); } else { $this ->error( '删除失败。' ); } } |