标签:lap his dir function control demo tree cat get
<?php
namespace Back\Controller;
use Think\Controller;
class CategoryController extends Controller
{
public function listAction()
{
$modelCategory = D(‘Category‘);
$this->assign(‘list‘, $modelCategory->getTreeList());
$this->display();
}
public function deleteAction()
{
$category_id = I(‘get.id‘, 0);
if ($category_id == 0) {
$this->redirect(‘list‘);
}
M(‘Category‘)->delete($category_id);
// 初始缓存配置
S([
‘type‘ => ‘Memcache‘,
‘host‘ => ‘192.168.118.128‘,
‘port‘ => ‘11211‘,
]);
// 删除
S(‘category_tree‘, null);
$this->redirect(‘list‘);
}
}标签:lap his dir function control demo tree cat get
原文地址:http://www.cnblogs.com/falling-maple/p/6239963.html