Skip to content

docs: [Validation] Add explanation where to place custom validation rules error messages #8343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -760,9 +760,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