Skip to content

Commit

Permalink
Merge pull request #8343 from dgvirtual/custom_rule_error_message_pla…
Browse files Browse the repository at this point in the history
…cement

docs: [Validation] Add explanation where to place custom validation rules error messages
  • Loading branch information
kenjis authored Dec 20, 2023
2 parents 8464580 + d32693e commit 36fd0ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,12 @@ a boolean true or false value signifying true if it passed the test or false if

.. literalinclude:: validation/034.php

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

.. literalinclude:: validation/035.php

Expand Down

0 comments on commit 36fd0ee

Please sign in to comment.