Skip to content

Commit

Permalink
完善升级文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Xhiny committed Nov 3, 2023
1 parent 0139253 commit 7bbe16b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,8 @@ composer require quansitech/qscmf-buttontype-modal
}
}
```
```
#### 升级指南
[升级指南](https://github.com/quansitech/qscmf-buttontype-modal/blob/master/Upgrade.md)
34 changes: 34 additions & 0 deletions Upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 升级指南

##### 升级至v2.0.0版本

+ 修改模态框表单,需要使用 bindFormBuilder 方法显示绑定 FormBuilder 对象
```php
// 旧版本写法
protected function buildAddModal(){
$modal = (new \Qs\ModalButton\ModalButtonBuilder());
// 省略其他代码
return $modal->setBody($this->add());
}

public function add(){
$builder = new FormBuilder();
// 省略其他代码
return $builder->build(true);
}
```
```php
// v2版本
protected function buildAddModal(){
$modal = (new \Qs\ModalButton\ModalButtonBuilder());
// 省略其他代码
return $modal->bindFormBuilder($this->add());
}

public function add(){
$builder = new FormBuilder();
// 省略其他代码
return $builder;
}
```
+ 废弃 setIsForward 方法提示,可用 setIsJump 方法替换

0 comments on commit 7bbe16b

Please sign in to comment.