Skip to content
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

docs: fix validation.rst #6563

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
20 changes: 11 additions & 9 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,16 @@ Custom errors can be returned as the fourth parameter, just as described above.
Available Rules
***************

The following is a list of all the native rules that are available to use:

.. note:: Rule is a string; there must be **no spaces** between the parameters, especially the ``is_unique`` rule.
There can be no spaces before and after ``ignore_value``.

.. literalinclude:: validation/038.php

Rules for General Use
=====================

The following is a list of all the native rules that are available to use:

======================= ========== ============================================= ===================================================
Rule Parameter Description Example
======================= ========== ============================================= ===================================================
Expand Down Expand Up @@ -676,9 +679,8 @@ required No Fails if the field is an empty array, empty
string, null or false.
required_with Yes The field is required when any of the other required_with[field1,field2]
required fields are present in the data.
required_without Yes The field is required when all of the other required_without[field1,field2]
fields are present in the data but not
required.
required_without Yes The field is required when any of other required_without[field1,field2]
fields do not pass ``required`` checks.
string No A generic alternative to the alpha* rules
that confirms the element is a string
timezone No Fails if field does match a timezone per
Expand Down Expand Up @@ -726,6 +728,10 @@ valid_cc_number Yes Verifies that the credit card number matches
HSBC Canada Card (hsbc)
======================= ========== ============================================= ===================================================

.. note:: You can also use any native PHP functions that return boolean and
permit at least one parameter, the field data to validate.
The Validation library **never alters the data** to validate.

.. _rules-for-file-uploads:

Rules for File Uploads
Expand Down Expand Up @@ -770,7 +776,3 @@ is_image Yes Fails if the file cannot be determined to be
======================= ========== ============================================= ===================================================

The file validation rules apply for both single and multiple file uploads.

.. note:: You can also use any native PHP functions that return boolean and
permit at least one parameter, the field data to validate.
The Validation library **never alters the data** to validate.