Welcome Guest, Not a member yet? Register   Sign In
External functions in form_validation.php file
#3

(This post was last modified: 05-02-2017, 11:41 AM by annx10.)

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



Theme © iAndrew 2016 - Forum software by © MyBB