Codeigniter form validation config file not working -


I'm using the technique to save the codeadder form validation rules as specified in the config file, but it does not seem that Maybe it is working.

I am also trying to start the verification callback function from a Validation_Callbacks.php library, which I am automatically loading via the autoload.php mechanism.

Below is a snippet of my Form_validation.php form validation rule config file:

   
  & lt ;? Php if (! Defined ('BASEPATH')) Exit ('no direct script entry is allowed'); / ** * Custom validation library with app-specific verification functions * / class validation_backback {/ * checked date string is formatted as expected / * function date_check ($ date) {$ ddmmyyyy = '(0 [1-9] ] | [12] [0- 9] | 3 [01]) [- \ /.] (0 [1-9] | 1 [012]) [- \ /.] (19 | 20) [0-9] ] {2} '; If (preg_match ("/ $ ddmmyyyy $ /", $ date)) {return TRUE; } And {$ this- & gt; Form_validation- & gt; Set_mess ('date_check', $ this-> lang- & gt; line ('error_register_dob_format')); return false; }} / * Determines that given birthday is related to people over 18 years of age. We believe the date_check method is already running, and the given date is in the expected format of DD / MM / yY * / function age_check ($ date) {$ piecesDate = explode ('/', $ date). ; $ PiecesNow = array (date ("d"), date ("m"), date ("y")); $ JdDate = GregorianToosed ($ piece date [1], $ piece date [0], $ piece date [2]); $ JdNow = GregorianTojed ($ pieces now [1], $ pieces now [0], $ pieces now [2]); $ DayDiff = $ jdNow - $ jdDate; If ($ dayDiff> = 6570) {return TRUE; } And {$ this-> form_validation- & gt; Set_message ('age_check', $ this-> Lang- & gt; line ('error_register_age_check')); return false; }}}  

I am implementing it using the standard:

  if ($ this-> form_validation- & gt; play ('register_user ') == incorrect) {  

My callback function is not being called. Am I missing something? Thanks in advance for any help you might be able to provide!

Be sure to:

When a rule group is a controller If the square / function has the same name, then the run () function will be applied to that category / function when it can be tested.

You can try to use the test:

  $ this-> Load-> Config ('configname');  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -