CodeIgniter Forums

Full Version: load library from different module in HVMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hello, I have the following structure


and I want my_vo to extends vo_abstract

what is the proper way to "include" vo_abstract inside the my_vo code. I definitely don't wanna do something like
include_once( APP_PATH.'modules/common/libraries/vo/vo_abstract.php' );
because the "modules" path may need to change. Can I somehow autoload ("include") the vo_abstract in CI (without instantiating it, as it is abstract)

Basically, what I'm after is how can one library in HMVC extend another library from a different module in the HMVC?

thank you.

El Forum

[eluser]S-Vizion Software and Development[/eluser]
Why not just simply load it with


El Forum

If one of your libs extends another lib from another module I'd say you didn't quite get the principle of HMVC which is modular separation. Separation includes separation of dependencies. Therefore, having a common/vo_abstract library being implemented by test/my_vo is not what HMVC enables you to have.

Either you should rethink the modular separation definition in regard to your files. Or search for
in your HMVC extension (I'm assuming you're using @wiredesignz HMVC). It will give you paths to all module location which you may loop through and load the library once you found the module's name (which should not be changed once it's named Wink )