@@ -743,7 +743,7 @@ Configuration
743743=============
744744
745745Once you have your views created, you need to let the Validation library know about them. Open **app/Config/Validation.php **.
746- Inside, you'll find the ``$templates `` property where you can list as many custom views as you want, and provide an
746+ Inside, you'll find the ``$templates `` property where you can list as many custom views as you want, and provide a
747747short alias they can be referenced by. If we were to add our example file from above, it would look something like:
748748
749749.. literalinclude :: validation/032.php
@@ -769,7 +769,7 @@ Creating Custom Rules
769769Using Rule Classes
770770==================
771771
772- Rules are stored within simple, namespaced classes. They can be stored any location you would like, as long as the
772+ Rules are stored within simple, namespaced classes. They can be stored in any location you would like, as long as the
773773autoloader can find it. These files are called RuleSets.
774774
775775Adding a RuleSet
@@ -781,7 +781,7 @@ add the new file to the ``$ruleSets`` array:
781781.. literalinclude :: validation/033.php
782782
783783You can add it as either a simple string with the fully qualified class name, or using the ``::class `` suffix as
784- shown above. The primary benefit here is that it provides some extra navigation capabilities in more advanced IDEs.
784+ shown above. The primary benefit of using the `` ::class `` suffix is that it provides some extra navigation capabilities in more advanced IDEs.
785785
786786Creating a Rule Class
787787---------------------
@@ -921,8 +921,9 @@ decimal No Fails if field contains anything other than
921921 ``- `` sign for the number.
922922differs Yes Fails if field does not differ from the one ``differs[field_name] ``
923923 in the parameter.
924- exact_length Yes Fails if field is not exactly the parameter ``exact_length[5] `` or ``exact_length[5,8,12] ``
925- value. One or more comma-separated values.
924+ exact_length Yes Fails if field length is not exactly ``exact_length[5] `` or ``exact_length[5,8,12] ``
925+ the parameter value. One or more
926+ comma-separated values are possible.
926927field_exists Yes Fails if field does not exist. (This rule was
927928 added in v4.5.0.)
928929greater_than Yes Fails if field is less than or equal to ``greater_than[8] ``
@@ -943,7 +944,7 @@ is_natural No Fails if field contains anything other than
943944is_natural_no_zero No Fails if field contains anything other than
944945 a natural number, except zero: 1, 2, 3, etc.
945946is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value] ``
946- exist . Can ignore records by field/value to
947+ exists . Can ignore records by field/value to
947948 filter (currently accept only one filter).
948949is_unique Yes Checks if this field value exists in the ``is_unique[table.field,ignore_field,ignore_value] ``
949950 database. Optionally set a column and value
@@ -975,8 +976,8 @@ required_without Yes The field is required when any of the other
975976 fields is `empty() `_ in the data.
976977string No A generic alternative to the alpha* rules
977978 that confirms the element is a string
978- timezone No Fails if field does match a timezone per
979- `timezone_identifiers_list() `_
979+ timezone No Fails if field does not match a timezone
980+ per `timezone_identifiers_list() `_
980981valid_base64 No Fails if field contains anything other than
981982 valid Base64 characters.
982983valid_json No Fails if field does not contain a valid JSON
@@ -1001,7 +1002,7 @@ valid_url_strict Yes Fails if field does not contain a valid URL.
10011002valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y] ``
10021003 Any string that `strtotime() `_ accepts is
10031004 valid if you don't specify an optional
1004- parameter to matches a date format.
1005+ parameter that matches a date format.
10051006 **So it is usually necessary to specify
10061007 the parameter. **
10071008valid_cc_number Yes Verifies that the credit card number matches ``valid_cc_number[amex] ``
@@ -1069,9 +1070,9 @@ uploaded Yes Fails if the name of the parameter does not
10691070 If you want the file upload to be optional
10701071 (not required), do not define this rule.
10711072
1072- max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]``
1073- parameter is larger than the second
1074- parameter in kilobytes (kb). Or if the file
1073+ max_size Yes Fails if the uploaded file is larger ``max_size[field_name,2048]``
1074+ than the second parameter
1075+ in kilobytes (kb). Or if the file
10751076 is larger than allowed maximum size declared
10761077 in php.ini config file -
10771078 ``upload_max_filesize `` directive.
0 commit comments