Hi, I know it is not a good exepireince.But just I want to know it is possible to access a function from model or controller class from a helper file in codeignitor.
Thanks
Hi, I know it is not a good exepireince.But just I want to know it is possible to access a function from model or controller class from a helper file in codeignitor.
Thanks
Yes, that is possible, you will have to load the helper class first like this:
$this->load->helper('name of helper class');
More Info:
cant you use something like this i believe.
$Helper =& load_class('Helper'); //Load the (Helper Loader) $this->load->helper becomes $helper
$Class = $Helper('Name of class');
But i do not see why you should do this
Can't you just create an extra model class like
class DBFile
{
...
}
then create your Model
class Model_SomeName extends DBFile
{
/*So no this uses DBFile instead of CI_Database or w.e it is*/
}