Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
slowlyo committed Jul 15, 2024
1 parent 9d56791 commit decbdf9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/guide/crud-component-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $pipeline = new \Illuminate\Pipeline\Pipeline();
$user = [
'name' => '张三',
'age' => 18,
'sex' => '男',
'gender' => '男',
];

$result = $pipeline
Expand All @@ -33,8 +33,8 @@ $result = $pipeline
function ($user, $next){ // 这里也可以直接传入 闭包
// 这里的 $user 是上一个类传递过来的数据

// 假设: GenderTransition 类中, 将 sex 设置为了 女
// 那么, 这个方法中 $user['sex'] = '女'
// 假设: GenderTransition 类中, 将 gender 设置为了 女
// 那么, 这个方法中 $user['gender'] = '女'

// 再次给 $user 添加属性
$user['address'] = 'M78 星云';
Expand All @@ -61,7 +61,7 @@ array(4) {
string(6) "张三"
["age"]=>
int(18)
["sex"]=>
["gender"]=>
string(1) "女"
["address"]=>
string(15) "M78 星云 123456"
Expand Down

0 comments on commit decbdf9

Please sign in to comment.