• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use anything as a rule and $this->some_model issue

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:
'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')?


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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.