@@ -897,15 +897,11 @@ Rule Parameter Description
897
897
======================= ========== ============================================= ===================================================
898
898
alpha No Fails if field has anything other than
899
899
alphabetic characters in ASCII.
900
- alpha_space No Fails if field contains anything other than
901
- alphabetic characters or spaces in ASCII.
902
900
alpha_dash No Fails if field contains anything other than
903
901
alphanumeric characters, underscores or
904
902
dashes in ASCII.
905
903
alpha_numeric No Fails if field contains anything other than
906
904
alphanumeric characters in ASCII.
907
- alpha_numeric_space No Fails if field contains anything other than
908
- alphanumeric or space characters in ASCII.
909
905
alpha_numeric_punct No Fails if field contains anything other than
910
906
alphanumeric, space, or this limited set of
911
907
punctuation characters: ``~ `` (tilde),
@@ -916,6 +912,10 @@ alpha_numeric_punct No Fails if field contains anything other than
916
912
``_ `` (underscore), ``+ `` (plus),
917
913
``= `` (equals), ``| `` (vertical bar),
918
914
``: `` (colon), ``. `` (period).
915
+ alpha_numeric_space No Fails if field contains anything other than
916
+ alphanumeric or space characters in ASCII.
917
+ alpha_space No Fails if field contains anything other than
918
+ alphabetic characters or spaces in ASCII.
919
919
decimal No Fails if field contains anything other than
920
920
a decimal number. Also accepts a ``+ `` or
921
921
``- `` sign for the number.
@@ -940,9 +940,11 @@ in_list Yes Fails if field is not within a predetermined
940
940
integer No Fails if field contains anything other than
941
941
an integer.
942
942
is_natural No Fails if field contains anything other than
943
- a natural number: 0, 1, 2, 3, etc.
943
+ a natural number: ``0 ``, ``1 ``, ``2 ``, ``3 ``
944
+ , etc.
944
945
is_natural_no_zero No Fails if field contains anything other than
945
- a natural number, except zero: 1, 2, 3, etc.
946
+ a natural number, except zero: ``1 ``, ``2 ``,
947
+ ``3 ``, etc.
946
948
is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value] ``
947
949
exists. Can ignore records by field/value to
948
950
filter (currently accept only one filter).
@@ -964,47 +966,22 @@ not_in_list Yes Fails if field is within a predetermined
964
966
list.
965
967
numeric No Fails if field contains anything other than
966
968
numeric characters.
967
- regex_match Yes Fails if field does not match the regular ``regex_match[/regex/] ``
968
- expression.
969
969
permit_empty No Allows the field to receive an empty array,
970
970
empty string, null or false.
971
+ regex_match Yes Fails if field does not match the regular ``regex_match[/regex/] ``
972
+ expression.
971
973
required No Fails if the field is an empty array, empty
972
974
string, null or false.
973
975
required_with Yes The field is required when any of the other ``required_with[field1,field2] ``
974
976
fields is not `empty() `_ in the data.
975
977
required_without Yes The field is required when any of the other ``required_without[field1,field2] ``
976
978
fields is `empty() `_ in the data.
977
- string No A generic alternative to the alpha* rules
979
+ string No A generic alternative to the ** alpha* * * rules
978
980
that confirms the element is a string
979
981
timezone No Fails if field does not match a timezone
980
982
per `timezone_identifiers_list() `_
981
983
valid_base64 No Fails if field contains anything other than
982
984
valid Base64 characters.
983
- valid_json No Fails if field does not contain a valid JSON
984
- string.
985
- valid_email No Fails if field does not contain a valid
986
- email address.
987
- valid_emails No Fails if any value provided in a comma
988
- separated list is not a valid email.
989
- valid_ip Yes Fails if the supplied IP is not valid. ``valid_ip[ipv6] ``
990
- Accepts an optional parameter of ``ipv4 `` or
991
- ``ipv6 `` to specify an IP format.
992
- valid_url No Fails if field does not contain (loosely) a
993
- URL. Includes simple strings that could be
994
- hostnames, like "codeigniter".
995
- **Normally, ** ``valid_url_strict `` **should
996
- be used. **
997
- valid_url_strict Yes Fails if field does not contain a valid URL. ``valid_url_strict[https] ``
998
- You can optionally specify a list of valid
999
- schemas. If not specified, ``http,https ``
1000
- are valid. This rule uses PHP's
1001
- ``FILTER_VALIDATE_URL ``.
1002
- valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y] ``
1003
- Any string that `strtotime() `_ accepts is
1004
- valid if you don't specify an optional
1005
- parameter that matches a date format.
1006
- **So it is usually necessary to specify
1007
- the parameter. **
1008
985
valid_cc_number Yes Verifies that the credit card number matches ``valid_cc_number[amex] ``
1009
986
the format used by the specified provider.
1010
987
Current supported providers are:
@@ -1025,11 +1002,37 @@ valid_cc_number Yes Verifies that the credit card number matches
1025
1002
Scotiabank Scotia Card (``scotia ``),
1026
1003
BMO ABM Card (``bmoabm ``),
1027
1004
HSBC Canada Card (``hsbc ``)
1005
+ valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y] ``
1006
+ Any string that `strtotime() `_ accepts is
1007
+ valid if you don't specify an optional
1008
+ parameter that matches a date format.
1009
+ **So it is usually necessary to specify
1010
+ the parameter. **
1011
+ valid_email No Fails if field does not contain a valid
1012
+ email address.
1013
+ valid_emails No Fails if any value provided in a comma
1014
+ separated list is not a valid email.
1015
+ valid_ip Yes Fails if the supplied IP is not valid. ``valid_ip[ipv6] ``
1016
+ Accepts an optional parameter of ``ipv4 `` or
1017
+ ``ipv6 `` to specify an IP format.
1018
+ valid_json No Fails if field does not contain a valid JSON
1019
+ string.
1020
+ valid_url No Fails if field does not contain (loosely) a
1021
+ URL. Includes simple strings that could be
1022
+ hostnames, like "codeigniter".
1023
+ **Normally, ** ``valid_url_strict `` **should
1024
+ be used. **
1025
+ valid_url_strict Yes Fails if field does not contain a valid URL. ``valid_url_strict[https] ``
1026
+ You can optionally specify a list of valid
1027
+ schemas. If not specified, ``http,https ``
1028
+ are valid. This rule uses PHP's
1029
+ ``FILTER_VALIDATE_URL ``.
1028
1030
======================= ========== ============================================= ===================================================
1029
1031
1030
1032
.. note :: You can also use any native PHP functions that return boolean and
1031
1033
permit at least one parameter, the field data to validate.
1032
- The Validation library **never alters the data ** to validate.
1034
+
1035
+ .. important :: The Validation library **never alters the data** to validate.
1033
1036
1034
1037
.. _timezone_identifiers_list() : https://www.php.net/manual/en/function.timezone-identifiers-list.php
1035
1038
.. _strtotime() : https://www.php.net/manual/en/function.strtotime.php
0 commit comments