Skip to content

Commit 340e28e

Browse files
committed
docs: fix incorrect dot array syntax keys
1 parent 50da213 commit 340e28e

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ If you need to retrieve all error messages for failed fields, you can use the ``
591591

592592
If no errors exist, an empty array will be returned.
593593

594-
When using a wildcard, the error will point to a specific field, replacing the asterisk with the appropriate key/keys::
594+
When using a wildcard (``*``), the error will point to a specific field, replacing the asterisk with the appropriate key/keys::
595595

596596
// for data
597597
'contacts' => [
@@ -606,10 +606,10 @@ When using a wildcard, the error will point to a specific field, replacing the a
606606
]
607607

608608
// rule
609-
'contacts.*.name' => 'required'
609+
'contacts.friends.*.name' => 'required'
610610

611611
// error will be
612-
'contacts.friends.1.name' => 'The contacts.*.name field is required.'
612+
'contacts.friends.1.name' => 'The contacts.friends.*.name field is required.'
613613

614614
Getting a Single Error
615615
======================

user_guide_src/source/libraries/validation/009.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* The data to test:
55
* [
66
* 'contacts' => [
7-
* 'name' => 'Joe Smith',
7+
* 'name' => 'Joe Smith',
88
* 'friends' => [
99
* [
1010
* 'name' => 'Fred Flinstone',
@@ -21,8 +21,3 @@
2121
$validation->setRules([
2222
'contacts.name' => 'required|max_length[60]',
2323
]);
24-
25-
// Fred Flintsone & Wilma
26-
$validation->setRules([
27-
'contacts.friends.name' => 'required|max_length[60]',
28-
]);

user_guide_src/source/libraries/validation/010.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
// Fred Flintsone & Wilma
44
$validation->setRules([
5-
'contacts.*.name' => 'required|max_length[60]',
5+
'contacts.friends.*.name' => 'required|max_length[60]',
66
]);

0 commit comments

Comments
 (0)