_model = new CategoryModel(); $this->_viewDatas["className"] = "Category"; $this->_viewPath .= strtolower($this->_viewDatas["className"]); $this->_viewDatas["title"] = lang($this->_viewDatas["className"] . ".title"); $this->_viewDatas["class_icon"] = CLASS_ICONS[strtoupper($this->_viewDatas["className"])]; helper($this->_viewDatas["className"]); } public function getFields(string $action = ""): array { $fields = [ "uid", "name", "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status", "head", "tail", ]; switch ($action) { case "index": case "excel": return [ "name", "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status", "created_at", ]; break; case "view": return [...$fields, "updated_at", "created_at"]; break; default: return $fields; break; } } public function getFieldFilters(): array { return ["isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status"]; } public function getFieldBatchFilters(): array { return parent::getFieldBatchFilters(); } }