Skip to content

Commit 7ef6cc9

Browse files
committed
docs: update example usage
1 parent db4f81c commit 7ef6cc9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,23 @@ import {instance} from 'php-form'
3030
'label' => 'Email',
3131
'value' => 'user1@example.com',
3232
];
33+
34+
$form_name = 'billy'
3335
`
3436

3537
const fields = await form.parse(code)
36-
// [{name: '$form_email', label: 'Email', value: 'user1@example.com'}]
38+
// [{name: '$form_email', label: 'Email', value: 'user1@example.com'}, {name: '$form_name', value: 'billy'}]
3739

3840
fields[0].value = 'user2@example.com'
41+
fields[1].value = 'magic'
3942

4043
code = await form.stringify(fields)
4144
// <?php $form_email = [
4245
// 'label' => 'Email',
4346
// 'value' => 'user2@example.com',
4447
// ];
48+
//
49+
// $form_name = 'magic'
4550
})
4651

4752

0 commit comments

Comments
 (0)