Jump to content


How to use preping functions in grocery crud form validation?

preping validation prep_for_form xss_clean prep_url strip_image_tags encode_php_tags

  • Please log in to reply
No replies to this topic

#1 fbn

fbn

    Member

  • Members
  • PipPip
  • 11 posts
  • LocationMadeira, Portugal

Posted 25 March 2015 - 12:43 PM

Hi,

 

How to use preping functions in set_rules like xss_clean, prep_for_form, prep_url, strip_image_tags and encode_php_tags?

 

Example:

 

$crud->set_rules('name', 'Name', 'required | prep_for_form'); does not work.

 

If i make this:

 

$crud->set_rules('name', 'Name', 'required | callback_prep_for_form');

 

function callback_prep_for_form ($string) {

 

$string = $this->form_validation->prep_for_form($string);

 

return $string

 

}

 

Is correct?







Also tagged with one or more of these keywords: preping, validation, prep_for_form, xss_clean, prep_url, strip_image_tags, encode_php_tags

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users