• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
External functions in form_validation.php file

#3
Hi, neuron.
Thank you very much for your help.

I had MY_Form_validation.php extending form_validation_library yet with several custom validation functions.
My problem was that I needed use a function is in a model (examples_model), for general use, not for validation. In that case I have tried this in form_validation.php file and it works:

PHP Code:
$this->CI =& get_instance();
$this->CI->load->model('examples/examples_model'); 

And then, I could use the function db_table of model Examples_model with:

PHP Code:
$this->CI->examples_model->db_table('table_name'

Maybe is very complex.

Regards.
Reply


Messages In This Thread
RE: External functions in form_validation.php file - by annx10 - 05-02-2017, 07:17 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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