![]() |
(02-28-2019, 12:45 PM)b126 Wrote: I did it and it’s working fine, with strings, and also with numeric values. One thing to be aware of is your code introduces a bug when you ask CI_Input::post() to return the entire $_POST array. i.e. PHP Code: $data = $this->input->post(); That might not be something you ever do, but future code maintenance or changes might run up against this. It's an easy thing to forget and a hard thing to point out to someone else coming to the project. I think you have to either override _fetch_from_array() - which is not as trivial as what you've done - or, you could do the following PHP Code: public function post($index = NULL, $xss_clean = NULL) Have you considered that you might want to trim the input in case somebody enters a string with empty spaces? |
Messages In This Thread |
Can I convert empty strings to NULL with a Codeigniter validation rule? - by b126 - 02-27-2019, 08:40 AM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by php_rocs - 02-27-2019, 01:10 PM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by b126 - 02-27-2019, 01:30 PM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by php_rocs - 02-27-2019, 03:58 PM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by b126 - 02-27-2019, 04:11 PM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by dave friend - 02-28-2019, 12:25 PM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by b126 - 02-28-2019, 12:45 PM
RE: Can I convert empty strings to NULL with a Codeigniter validation rule? - by dave friend - 02-28-2019, 01:39 PM
|