Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 3.1.10 Trim Rule
#1

(This post was last modified: 09-05-2019, 11:35 PM by ChicagoPhil.)

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

(This post was last modified: 09-06-2019, 02:38 AM by dave friend.)

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




Theme © iAndrew 2016 - Forum software by © MyBB