Skip to content

Commit

Permalink
docs: Small typos in libraries/validation.rst
Browse files Browse the repository at this point in the history
Small typos in libraries/validation.rst
  • Loading branch information
obozdag authored May 23, 2024
1 parent 47cb203 commit 550557e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ Configuration
=============

Once you have your views created, you need to let the Validation library know about them. Open **app/Config/Validation.php**.
Inside, you'll find the ``$templates`` property where you can list as many custom views as you want, and provide an
Inside, you'll find the ``$templates`` property where you can list as many custom views as you want, and provide a
short alias they can be referenced by. If we were to add our example file from above, it would look something like:

.. literalinclude:: validation/032.php
Expand All @@ -769,7 +769,7 @@ Creating Custom Rules
Using Rule Classes
==================

Rules are stored within simple, namespaced classes. They can be stored any location you would like, as long as the
Rules are stored within simple, namespaced classes. They can be stored in any location you would like, as long as the
autoloader can find it. These files are called RuleSets.

Adding a RuleSet
Expand All @@ -781,7 +781,7 @@ add the new file to the ``$ruleSets`` array:
.. literalinclude:: validation/033.php

You can add it as either a simple string with the fully qualified class name, or using the ``::class`` suffix as
shown above. The primary benefit here is that it provides some extra navigation capabilities in more advanced IDEs.
shown above. The primary benefit of using the ``::class`` suffix is that it provides some extra navigation capabilities in more advanced IDEs.

Creating a Rule Class
---------------------
Expand Down Expand Up @@ -921,8 +921,9 @@ decimal No Fails if field contains anything other than
``-`` sign for the number.
differs Yes Fails if field does not differ from the one ``differs[field_name]``
in the parameter.
exact_length Yes Fails if field is not exactly the parameter ``exact_length[5]`` or ``exact_length[5,8,12]``
value. One or more comma-separated values.
exact_length Yes Fails if field length is not exactly ``exact_length[5]`` or ``exact_length[5,8,12]``
the parameter value. One or more
comma-separated values are possible.
field_exists Yes Fails if field does not exist. (This rule was
added in v4.5.0.)
greater_than Yes Fails if field is less than or equal to ``greater_than[8]``
Expand All @@ -943,7 +944,7 @@ is_natural No Fails if field contains anything other than
is_natural_no_zero No Fails if field contains anything other than
a natural number, except zero: 1, 2, 3, etc.
is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value]``
exist. Can ignore records by field/value to
exists. Can ignore records by field/value to
filter (currently accept only one filter).
is_unique Yes Checks if this field value exists in the ``is_unique[table.field,ignore_field,ignore_value]``
database. Optionally set a column and value
Expand Down Expand Up @@ -975,8 +976,8 @@ required_without Yes The field is required when any of the other
fields is `empty()`_ in the data.
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
`timezone_identifiers_list()`_
timezone No Fails if field does not match a timezone
per `timezone_identifiers_list()`_
valid_base64 No Fails if field contains anything other than
valid Base64 characters.
valid_json No Fails if field does not contain a valid JSON
Expand All @@ -1001,7 +1002,7 @@ valid_url_strict Yes Fails if field does not contain a valid URL.
valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y]``
Any string that `strtotime()`_ accepts is
valid if you don't specify an optional
parameter to matches a date format.
parameter that matches a date format.
**So it is usually necessary to specify
the parameter.**
valid_cc_number Yes Verifies that the credit card number matches ``valid_cc_number[amex]``
Expand Down Expand Up @@ -1069,9 +1070,9 @@ uploaded Yes Fails if the name of the parameter does not
If you want the file upload to be optional
(not required), do not define this rule.

max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]``
parameter is larger than the second
parameter in kilobytes (kb). Or if the file
max_size Yes Fails if the uploaded file is larger ``max_size[field_name,2048]``
than the second parameter
in kilobytes (kb). Or if the file
is larger than allowed maximum size declared
in php.ini config file -
``upload_max_filesize`` directive.
Expand Down

0 comments on commit 550557e

Please sign in to comment.