I'm just getting acquainted with Add-on development beyond basic plugins and I'm not exactly sure the proper way to organize my files.
I have a base Module file, mod.xxxx.php that has a handful of methods within. I am now realizing I need an extension as well to hook into a few base EE hooks. Within the extension, I want to use a few helper methods from my module but I'm not sure the proper way to share them between the Module and Extension.
I tried
if (class_exists('Modulename') === false)
{
require_once PATH_THIRD.'modulename/mod.modulename.php';
}
$modulename = new Modulename();
And then called
$modulename->modulemethod($variable);
In the extension, but it's not returning the right type, rather an empty array.
Should these "helper" functions really be moved into a helper file and then loaded into both the extension and the module using the load->helper function of CI?