Skip to content

Commit 36fd0ee

Browse files
authored
Merge pull request #8343 from dgvirtual/custom_rule_error_message_placement
docs: [Validation] Add explanation where to place custom validation rules error messages
2 parents 8464580 + d32693e commit 36fd0ee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

user_guide_src/source/libraries/validation.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,12 @@ a boolean true or false value signifying true if it passed the test or false if
762762

763763
.. literalinclude:: validation/034.php
764764

765-
By default, the system will look within **system/Language/en/Validation.php** for the language strings used
766-
within errors. In custom rules, you may provide error messages by accepting a ``&$error`` variable by reference in the
767-
second parameter:
765+
By default, the system will look within **system/Language/en/Validation.php** for the language strings used within
766+
errors. To provide default error messages for your custom rules, you may place them in **app/Language/en/Validation.php**
767+
(and/or corresponding folder of locale you use in place of ``en``). Also, in case you want to use some other language
768+
string file in place of the default **Validation.php**, you may provide error messages by accepting an ``&$error``
769+
variable by reference in the second (or, in case your rule needs to work with parameters, as described below – the
770+
fourth) parameter:
768771

769772
.. literalinclude:: validation/035.php
770773

0 commit comments

Comments
 (0)