• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
load library from different module in HVMC

#1
[eluser]scibuff[/eluser]
Hello, I have the following structure

Code:
/application
/application/modules/common/libraries/vo/vo_abstract
/application/modules/test/libraries/vo/my_vo

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
Code:
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.

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

$this->load->library('modulename/libraryname');


#3
[eluser]PhilTem[/eluser]
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
Code:
Modules::$locations
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 )


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.