Welcome Guest, Not a member yet? Register   Sign In
Problems with extending CI_Form_validation
#3

(07-29-2017, 09:07 AM)skunkbad Wrote: You're doing it wrong. Try this:

https://codeigniter.com/user_guide/libra...-as-a-rule

I'm kind of confuse with this user guide

I tried this [doesn't work]
PHP Code:
$this->form_validation->set_rules('email''', array(
 
       array($this->AdvancedValidation'scanEmail')
)); 
The Error is
Log
Code:
ERROR - 2017-07-30 11:19:48 --> Severity: Warning --> preg_match() expects parameter 2 to be string, array given /Applications/XAMPP/xamppfiles/htdocs/xyz/system/libraries/Form_validation.php 693
ERROR - 2017-07-30 11:19:48 --> Severity: Warning --> method_exists() expects parameter 2 to be string, array given /Applications/XAMPP/xamppfiles/htdocs/xyz/system/libraries/Form_validation.php 749
ERROR - 2017-07-30 11:19:48 --> Severity: Warning --> function_exists() expects parameter 1 to be string, array given /Applications/XAMPP/xamppfiles/htdocs/xyz/system/libraries/Form_validation.php 753
validation_errors()
Code:
bool(false) string(101) "
Unable to access an error message corresponding to your field name email.(Anonymous function)
"

However, when I use Anonymous Function it work which I'm not looking for
PHP Code:
$this->form_validation->set_rules('email''', array(
 function(
$value)
 {
 return 
TRUE;
 }
)); 
Reply


Messages In This Thread
RE: Problems with extending CI_Form_validation - by ardavan - 07-29-2017, 08:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB