Skip to content

Commit

Permalink
Add missing docs for {field} and {param} placeholders in validation m…
Browse files Browse the repository at this point in the history
…essages. Closes #1503
  • Loading branch information
lonnieezell committed Nov 19, 2018
1 parent 69353cb commit 27868b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,14 @@ Or as a labeled style::
]
);

If you’d like to include a field’s “human” name, or the optional parameter some rules allow for (such as max_length),
you can add the ``{field}`` and ``{param}`` tags to your message, respectively::

'min_length' => '{field} must have at least {param} characters.'

On a field with the human name Username and a rule of min_length[5], an error would display: “Username must have
at least 5 characters.”

.. note:: If you pass the last parameter the labeled style error messages will be ignored.

Getting All Errors
Expand Down

0 comments on commit 27868b2

Please sign in to comment.