Hope this is just something quick, but I can't find something that works.
I want to check if a function exists in a model from a controller in CodeIgniter, and if it does, it should run the function.
I have tried the following:
$comp_model = 'model_comp_'.$comp_code;
$this->load->model('comp/'.$comp_model);
if (function_exists($this->$comp_model->join_comp))
...
and
if (method_exists($this, $comp_model->join_comp()))
...
even just calling the function in the if statement
if ($this->$comp_model->join_comp())
...
Please help!