From 9838c16c375be41d6c89fc66d922f88506797bd4 Mon Sep 17 00:00:00 2001 From: Joseph Wensley Date: Wed, 5 Oct 2011 19:49:29 -0400 Subject: format rule reference table --- .../source/libraries/form_validation.rst | 118 +++++---------------- 1 file changed, 29 insertions(+), 89 deletions(-) diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 375bb468d..e5f682442 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -838,95 +838,35 @@ Rule Reference The following is a list of all the native rules that are available to use: -Rule -Parameter -Description -Example -**required** -No -Returns FALSE if the form element is empty. -**matches** -Yes -Returns FALSE if the form element does not match the one in the -parameter. -matches[form_item] -**is_unique** -Yes -Returns FALSE if the form element is not unique to the table and field -name in the parameter. -is_unique[table.field] -**min_length** -Yes -Returns FALSE if the form element is shorter then the parameter value. -min_length[6] -**max_length** -Yes -Returns FALSE if the form element is longer then the parameter value. -max_length[12] -**exact_length** -Yes -Returns FALSE if the form element is not exactly the parameter value. -exact_length[8] -**greater_than** -Yes -Returns FALSE if the form element is less than the parameter value or -not numeric. -greater_than[8] -**less_than** -Yes -Returns FALSE if the form element is greater than the parameter value or -not numeric. -less_than[8] -**alpha** -No -Returns FALSE if the form element contains anything other than -alphabetical characters. -**alpha_numeric** -No -Returns FALSE if the form element contains anything other than -alpha-numeric characters. -**alpha_dash** -No -Returns FALSE if the form element contains anything other than -alpha-numeric characters, underscores or dashes. -**numeric** -No -Returns FALSE if the form element contains anything other than numeric -characters. -**integer** -No -Returns FALSE if the form element contains anything other than an -integer. -**decimal** -Yes -Returns FALSE if the form element is not exactly the parameter value. -**is_natural** -No -Returns FALSE if the form element contains anything other than a natural -number: 0, 1, 2, 3, etc. -**is_natural_no_zero** -No -Returns FALSE if the form element contains anything other than a natural -number, but not zero: 1, 2, 3, etc. -**is_unique** -Yes -Returns FALSE if the form element is not unique in a database table. -is_unique[table.field] -**valid_email** -No -Returns FALSE if the form element does not contain a valid email -address. -**valid_emails** -No -Returns FALSE if any value provided in a comma separated list is not a -valid email. -**valid_ip** -No -Returns FALSE if the supplied IP is not valid. -**valid_base64** -No -Returns FALSE if the supplied string contains anything other than valid -Base64 characters. +.. table:: +======================= ========== ============================================================================================= ======================= +Rule Parameter Description Example +======================= ========== ============================================================================================= ======================= +**required** No Returns FALSE if the form element is empty. +**matches** Yes Returns FALSE if the form element does not match the one in the parameter. matches[form_item] +**is_unique** Yes Returns FALSE if the form element is not unique to the is_unique[table.field] + table and field name in the parameter. is_unique[table.field] +**max_length** Yes Returns FALSE if the form element is longer then the parameter value. max_length[12] +**exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8] +**greater_than** Yes Returns FALSE if the form element is less than the parameter value or not numeric. greater_than[8] +**less_than** Yes Returns FALSE if the form element is greater than the parameter value or not numeric. less_than[8] +**alpha** No Returns FALSE if the form element contains anything other than alphabetical characters. +**alpha_numeric** No Returns FALSE if the form element contains anything other than alpha-numeric characters. +**alpha_dash** No Returns FALSE if the form element contains anything other than alpha-numeric characters, + underscores or dashes. +**numeric** No Returns FALSE if the form element contains anything other than numeric characters. +**integer** No Returns FALSE if the form element contains anything other than an integer. +**decimal** Yes Returns FALSE if the form element is not exactly the parameter value. +**is_natural** No Returns FALSE if the form element contains anything other than a natural number: + 0, 1, 2, 3, etc. +**is_natural_no_zero** No Returns FALSE if the form element contains anything other than a natural + number, but not zero: 1, 2, 3, etc. +**is_unique** Yes Returns FALSE if the form element is not unique in a database table. is_unique[table.field] +**valid_email** No Returns FALSE if the form element does not contain a valid email address. +**valid_emails** No Returns FALSE if any value provided in a comma separated list is not a valid email. +**valid_ip** No Returns FALSE if the supplied IP is not valid. +**valid_base64** No Returns FALSE if the supplied string contains anything other than valid Base64 characters. +======================= ========== ============================================================================================= ======================= .. note:: These rules can also be called as discrete functions. For example:: -- cgit v1.2.3-24-g4f1b From 34acc44043b0dc9d4ae9fe12b5c54f3bb35da9aa Mon Sep 17 00:00:00 2001 From: Joseph Wensley Date: Wed, 5 Oct 2011 19:54:11 -0400 Subject: format Prepping Reference table --- .../source/libraries/form_validation.rst | 29 +++++++--------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index e5f682442..0dbb44616 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -883,26 +883,15 @@ Prepping Reference The following is a list of all the prepping functions that are available to use: -Name -Parameter -Description -**xss_clean** -No -Runs the data through the XSS filtering function, described in the -:doc:`Input Class ` page. -**prep_for_form** -No -Converts special characters so that HTML data can be shown in a form -field without breaking it. -**prep_url** -No -Adds "http://" to URLs if missing. -**strip_image_tags** -No -Strips the HTML from image tags leaving the raw URL. -**encode_php_tags** -No -Converts PHP tags to entities. +==================== ========= =================================================================================================== +Name Parameter Description +============================== =================================================================================================== +**xss_clean** No Runs the data through the XSS filtering function, described in the :doc:`Input Class ` page. +**prep_for_form** No Converts special characters so that HTML data can be shown in a form field without breaking it. +**prep_url** No Adds "http://" to URLs if missing. +**strip_image_tags** No Strips the HTML from image tags leaving the raw URL. +**encode_php_tags** No Converts PHP tags to entities. +==================== ========= =================================================================================================== .. note:: You can also use any native PHP functions that permit one parameter, like trim, htmlspecialchars, urldecode, etc. -- cgit v1.2.3-24-g4f1b