CodeIgniter Forums
HMVC - MY_Modules - extending modules.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: HMVC - MY_Modules - extending modules.php (/showthread.php?tid=43097)



HMVC - MY_Modules - extending modules.php - El Forum - 06-30-2011

[eluser]SPeed_FANat1c[/eluser]
Hi, there is possible to extend router.php and loader.php but I tried extendint modules.php the same way, but no success - the is no signs that it has been called. I guess this is because native CI does not have modules library and therefore it does not work when I have file MY_Modules.php

Have someone tried doing this? Or have any thoughs how to do this?


HMVC - MY_Modules - extending modules.php - El Forum - 06-30-2011

[eluser]web-johnny[/eluser]
[quote author="SPeed_FANat1c" date="1309437716"]Hi, there is possible to extend router.php and loader.php but I tried extendint modules.php the same way, but no success - the is no signs that it has been called. I guess this is because native CI does not have modules library and therefore it does not work when I have file MY_Modules.php

Have someone tried doing this? Or have any thoughs how to do this?[/quote] You can use the packages of CI 2 you can see them at : http://ellislab.com/codeigniter/user-guide/libraries/loader.html is below of the article or else you can use hmvc or else Matchbox


HMVC - MY_Modules - extending modules.php - El Forum - 06-30-2011

[eluser]SPeed_FANat1c[/eluser]
Quote:or else you can use hmvc

I am already using HMVC and there is a file Modules.php in third_party/MX folder. But how can I extend it?

Or something I did not understand what did you want to say?


HMVC - MY_Modules - extending modules.php - El Forum - 06-30-2011

[eluser]InsiteFX[/eluser]
You cannot use the MY_ prefix because the Modules.php is being loaded using spl_autoload, not being loaded by CI.

Try extending it without the MY_ prefix.

InsiteFX


HMVC - MY_Modules - extending modules.php - El Forum - 06-30-2011

[eluser]SPeed_FANat1c[/eluser]
[quote author="InsiteFX" date="1309484998"]You cannot use the MY_ prefix because the Modules.php is being loaded using spl_autoload, not being loaded by CI.

Try extending it without the MY_ prefix.

InsiteFX[/quote]

Did not try without MY_ yet but I am thinking - how then I will force it to load? For example MY_Router.php is loaded automatically because the Router.php is loaded by CI or something like that.


HMVC - MY_Modules - extending modules.php - El Forum - 06-30-2011

[eluser]InsiteFX[/eluser]
The Modules.php is autoloaded with spl_autoload

Try extending it and see if it will pick it up. If not you may need to include it then extend it.

InsiteFX


HMVC - MY_Modules - extending modules.php - El Forum - 07-01-2011

[eluser]SPeed_FANat1c[/eluser]
ok, thank you, we'll try that later and see what happens.