Welcome Guest, Not a member yet? Register   Sign In
Use anything as a rule and $this->some_model issue
#1

I'm trying to perform form validation from within a specific method ('my_user_model', in fact I'm extending on Lonnie Ezell's MY_Model using 'in model' validation), but I'm getting issues with custom validation rules. Callbacks didn't work because the callback could not be found in 'my_user_model'...
So I've gone through the new user guide, where I read about 'use-anything-as-a-rule'
in the form_validation user guide.
But when I try to validate a field in my controller in this way:

PHP Code:
$this->form_validation->set_rules('birthdate''Birthdate'
array(
'required', array('birthdate_callable', array($this->my_user_model'checkdateformat'))); 

I'm getting a parse error on '$this' : "syntax error, unexpected '$this' (T_VARIABLE), expecting ')'"

Does somebody has experience with this new extension ('Use anything as a rule')?

Thanks!
Reply


Messages In This Thread
Use anything as a rule and $this->some_model issue - by Zeff - 01-31-2018, 07:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB