Skip to content

Commit 32e511a

Browse files
committed
Forgot parenthesis in code example in userguide.
1 parent 040dfdf commit 32e511a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,21 +425,21 @@ replaced by the **value** of the matched incoming field. An example should clari
425425

426426
$validation->setRules([
427427
'email' => 'required|valid_email|is_unique[users.email,id,{id}]'
428-
];
428+
]);
429429

430430
In this set of rules, it states that the email address should be unique in the database, except for the row
431431
that has an id matching the placeholder's value. Assuming that the form POST data had the following::
432432

433433
$_POST = [
434434
'id' => 4,
435435
'email' => 'foo@example.com'
436-
]
436+
];
437437

438438
then the ``{id}`` placeholder would be replaced with the number **4**, giving this revised rule::
439439

440440
$validation->setRules([
441441
'email' => 'required|valid_email|is_unique[users.email,id,4]'
442-
];
442+
]);
443443

444444
So it will ignore the row in the database that has ``id=4`` when it verifies the email is unique.
445445

0 commit comments

Comments
 (0)