Form Validation and callbacks |
[eluser]kilishan[/eluser]
Hey gang, Working on an issue with Bonfire and it seems that the form_validation callbacks aren't working any more. I could have sworn I had these working before, but now they don't even appear to be called. Am I missing something here? Code: if ($this->input->post('submit'))
[eluser]InsiteFX[/eluser]
You should not be using $_POST but $this->input->post('email', TRUE); The call_back should be the last rule on the validation rules with nothing after it. You can also make the call_backs private by doing this Code: // add an extra underscore to the call_back InsiteFX
[eluser]kilishan[/eluser]
Nice tip about making it private. Thanks! As for $this->input->post vs $_POST, it's my understanding the only thing the helper function does is return false if not set, correct? On the email validation rule, the callback is the only rule in there, and it's still not making it to the actual callback function. I am running HMVC, but I've already assigned the CI pointer to $this in MY_Controller. I'm pretty sure, anyway. I'll have to double-check.
[eluser]InsiteFX[/eluser]
Quote:As for $this->input->post vs $_POST, it’s my understanding the only thing the helper function does is return false if not set, correct? No: $this->input->post will return the same thing. CodeIgniter User Guide - Input Class As for HMVC I would double check that, that sounds like where your problem is. You may need to add the $this to you code above. InsiteFX
[eluser]kilishan[/eluser]
Yup. It was the HMVC issue. Thanks for the help in kicking the dust out of my brain.
[eluser]InsiteFX[/eluser]
LOL! No problem, glad you got it working! InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |