合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
``` <?php namespace app\agent\controller; use app\agent\model\AgentCategoryModel; use think\Controller; class AdminCategoryController extends Controller { /** * 添加文章分类提交 */ public function addPost() { $agentCategoryModel = new AgentCategoryModel(); $data = $this->request->param(); $result = $this->validate($data, 'AgentCategory'); if ($result !== true) { $this->error($result); } $result = $agentCategoryModel->addCategory($data); if ($result === false) { $this->error('添加失败!'); } $this->success('添加成功!', url('AdminCategory/index')); } } ```