/** * 添加文章 */ public function add() { $this->checkLogin(); $Department = new DepartmentModel(); $departments = $Department->getAllDepartments(); $category = new CategoryModel(); $categories = $category->getCategories(); $this->assign('categories', $categories); $this->assign('departments', $departments); $this->display(); }