• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter 3.1.10 Trim Rule

#1
The form validation rule "trim" seems to be missing from the library. when using this rule I noticed a line in my log file that reads "Unable to find validation rules".

In the user guide it still refers to the rule in the "alpha_numeric_spaces" rule:

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.

is Trim no longer a useful rule?

I apologize if I missed something here.
Reply

#2
The "trim rule" is quite literally the native PHP function trim and so is not in Form_validation.php. The documentation says that any native PHP function that accepts one parameter can be used as a rule.
Reply

#3
Ok, I just wanted to make sure I wasn't writing in trim all over the place and have it doing nothing. I'll have to dig into the log files more to see what's throwing that error.
Reply

#4
The error is logged in validation->run() and is quite literal. It cannot find any associated rules in any of the places it expects to find them.

How are you setting rules and where?
Reply

#5
(09-06-2019, 03:56 AM)dave friend Wrote: The error is logged in validation->run() and is quite literal. It cannot find any associated rules in any of the places it expects to find them.

How are you setting rules and where?

The rules are all set in the form_validation config as an array of arrays. I'm away from my computer at the moment so my answer is from memory.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.