model = new StockLogModel(); } //查看 #[Route("GET,JSON","index")] public function index() { return $this->_index(); } //添加 #[Route("GET,POST","add")] public function add() { //通过定义postParams来增加或覆盖post提交的表单 $this->postParams=[]; //通过定义callback回调函数来执行添加后的操作 $this->callback=function ($model){}; return $this->_add(); } //修改 #[Route("GET,POST","edit")] public function edit() { //通过定义postParams来增加或覆盖post提交的表单 $this->postParams=[]; //通过定义callback回调函数来执行修改后的操作 $this->callback=function ($model){}; return $this->_edit(); } }