File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 2020 "email|email " => 'Please enter a valid email address ' ,
2121 "int:age " => 'Age is required ' ,
2222 "int:age:<:16 " => 'Sorry! you must be 16yrs and above to use this site ' ,
23+ "array:activities " => 'Select one or more activities ' ,
2324 ])->save (function ($ response ){
2425 // access the form data
2526 $ param = $ response ->param ;
3435 $ param ->email ,
3536 $ param ['name ' ],
3637 $ attribute ->occupation ,
37- // $response
38+ $ param -> activities
3839 );
3940
4041 // var_dump( $response->getForm() );
4142 });
42-
43- // dd(
44- // old('activities.swimming')
45- // );
46-
4743
4844?>
4945
8076
8177 <div class="">
8278 <label for="html">Age</label>
83- <input type="text " name="age" value="<?= old ('age ' ); ?> ">
79+ <input type="number " name="age" value="<?= old ('age ' ); ?> ">
8480 </div>
8581
8682 <div class="activities">
9086
9187 <label for="reading">
9288 Reading
93- <input type="checkbox" name="activities[]" value="reading" id="reading" <?= isset ( old ('activities ' )[ ' reading '] ) ? 'checked ' : '' ?> >
89+ <input type="checkbox" name="activities[]" value="reading" id="reading" <?= old ('activities. reading ' ) ? 'checked ' : '' ?> >
9490 </label>
9591 <label for="writing">
9692 Writing
97- <input type="checkbox" name="activities[]" value="writing" id="writing" <?= isset ( old ('activities ' )[ ' writing '] ) ? 'checked ' : '' ?> >
93+ <input type="checkbox" name="activities[]" value="writing" id="writing" <?= old ('activities. writing ' ) ? 'checked ' : '' ?> >
9894 </label>
9995 <label for="running">
10096 Running
Original file line number Diff line number Diff line change 2121
2222 dump (
2323 $ param ,
24- $ response ->param
24+ $ response ->param -> toObject ()
2525 );
2626 });
2727
6060
6161 <div class="">
6262 <label for="html">Age</label>
63- <input type="text " name="age" value="<?= $ form ->old ('age ' ); ?> ">
63+ <input type="number " name="age" value="<?= $ form ->old ('age ' ); ?> ">
6464 </div>
6565
6666 <button type="submit" class="btn mt-2">Submit</button>
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ class: [
3535 })->after (function (){
3636
3737 print_r ("**after Submit usage example** <br> " );
38- })->save (function ($ response ) use ($ outsideParam ){
38+ })
39+ ->save (function ($ response ) use ($ outsideParam ){
3940 // access the form data
4041 $ param = $ response ->param ;
4142
You can’t perform that action at this time.
0 commit comments