diff options
author | Derek Jones <derek.jones@ellislab.com> | 2013-07-21 22:35:02 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2013-07-21 22:35:02 +0200 |
commit | ca51e1a5695bfdf76d8db599ee6c7ba16c328bbc (patch) | |
tree | eeb3db2494e1e2c9855864cb10ddfb617ee8731c /user_guide_src/source/libraries/form_validation.rst | |
parent | da671680202c030a3347ab77f4fe0ead23c8886a (diff) |
removing php: directive prefix from docs source as it is not necessary
Diffstat (limited to 'user_guide_src/source/libraries/form_validation.rst')
-rw-r--r-- | user_guide_src/source/libraries/form_validation.rst | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 8b35fdc75..5dffb1cd1 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -477,8 +477,8 @@ following method:: Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed. -If you'd like to include a field's "human" name, or the optional -parameter some rules allow for (such as max_length), you can add the +If you'd like to include a field's "human" name, or the optional +parameter some rules allow for (such as max_length), you can add the **{field}** and **{param}** tags to your message, respectively:: $this->form_validation->set_message('min_length', '{field} must have at least {param} characters.'); @@ -860,14 +860,14 @@ 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] -**differs** Yes Returns FALSE if the form element does not differ from the one in the parameter. differs[form_item] -**is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] - parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be +**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] +**differs** Yes Returns FALSE if the form element does not differ from the one in the parameter. differs[form_item] +**is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] + parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be enabled in order to work. -**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] +**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 or equal to the parameter value or not greater_than[8] numeric. **greater_than_equal_to** Yes Returns FALSE if the form element is less than the parameter value, greater_than_equal_to[8] @@ -876,15 +876,15 @@ Rule Parameter Description not numeric. **less_than_equal_to** Yes Returns FALSE if the form element is greater than the parameter value, less_than_equal_to[8] or not numeric. -**alpha** No Returns FALSE if the form element contains anything other than alphabetical characters. +**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_numeric_spaces** No Returns FALSE if the form element contains anything other than alpha-numeric characters - or spaces. Should be used after trim to avoid spaces at the beginning or end. -**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** No Returns FALSE if the form element contains anything other than a decimal number. + or spaces. Should be used after trim to avoid spaces at the beginning or end. +**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** No Returns FALSE if the form element contains anything other than a decimal number. **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 @@ -933,14 +933,14 @@ Name Parameter Description Class Reference *************** -.. php:class:: Form_validation +.. class:: Form_validation The following methods are intended for use in your controller. $this->form_validation->set_rules() =================================== - .. php:method:: set_rules ($field, $label = '', $rules = '') + .. method:: set_rules ($field, $label = '', $rules = '') :param string $field: The field name :param string $label: The field label @@ -955,8 +955,8 @@ $this->form_validation->set_rules() $this->form_validation->run() ============================= - - .. php:method:: run ($group = '') + + .. method:: run ($group = '') :param string $group: The name of the validation group to run :rtype: Boolean @@ -967,8 +967,8 @@ $this->form_validation->run() $this->form_validation->set_message() ===================================== - - .. php:method:: set_message ($lang, $val = '') + + .. method:: set_message ($lang, $val = '') :param string $lang: The rule the message is for :param string $val: The message @@ -978,8 +978,8 @@ $this->form_validation->set_message() $this->form_validation->set_data() ================================== - - .. php:method:: set_data ($data = '') + + .. method:: set_data ($data = '') :param array $data: The data to validate @@ -989,15 +989,15 @@ $this->form_validation->set_data() $this->form_validation->reset_validation() ========================================== - .. php:method:: reset_validation () + .. method:: reset_validation () Permits you to reset the validation when you validate more than one array. This method should be called before validating each new array. $this->form_validation->error_array() ===================================== - - .. php:method:: error_array () + + .. method:: error_array () :rtype: Array @@ -1031,7 +1031,7 @@ Shows all error messages as a string: Example:: <?php echo validation_errors(); ?> -The error delimiters can be optionally specified. See the +The error delimiters can be optionally specified. See the :ref:`changing-delimiters` section above. set_value() |