Welcome Guest, Not a member yet? Register   Sign In
non object issue
#11

[eluser]Kosonome[/eluser]
Oh, you are using php4.

Usually you can do that like this.

Code:
$this->form_validation->set_rules('field', 'Name_of_Field', 'callback_captcha');

function captcha($str)
    {
    }

Maybe you can access the field name with $this->input->post('field') or $this->form_validation->field inside the callback. Not sure.
#12

[eluser]megabyte[/eluser]
Jedd,

My class is capitalized:

Code:
class Math_captcha {

If I look at the core other libraries have this exact naming style.

I'm not trying to argue with you, but I'mnot sure what you think is named wrong.


As mentioned it seems its a php4 issue.


However I still can't figure out why moving my callback function to MY_Form_validation does not work at all.
#13

[eluser]megabyte[/eluser]
Kosonome


Using it as a callback works, but I wanna move it to MY_Form_validation for portability.
#14

[eluser]Kosonome[/eluser]
Well, you can make a plugin, and load before use validations since it accepts functions like trim(), htmlspecialchars(), etc... I sense this is a bad idea anyways.




Theme © iAndrew 2016 - Forum software by © MyBB