CodeIgniter Forums
Modular Extensions - HMVC version 5.3 - 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: Modular Extensions - HMVC version 5.3 (/showthread.php?tid=33523)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39


Modular Extensions - HMVC version 5.3 - El Forum - 10-27-2010

[eluser]wilso417[/eluser]
Hey guys,

I recently just tried to upgrade to HMVC 5.3.4 and i'm using CI 1.7.2.
It seems to me that Base.php is never being used and my auto-loaded libraries from config/audoload.php are not being loaded, like my dwoo template class. What am I doing wrong?


Modular Extensions - HMVC version 5.3 - El Forum - 10-27-2010

[eluser]wiredesignz[/eluser]
@wilso417, You are probably not doing anything wrong.
I just realized that Modular Separation does not allow autoloading from modules/config/autoload.php I will be adding this to the Bitbucket source today. Thanks for alerting me to this.


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]wilso417[/eluser]
Thank wiredesignz, I was referring to the libraries in:

application/config/audoload.php

So does third_party/MX/base.php ever get called?


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]wilso417[/eluser]
I've also noticed:

Controllers can be loaded as class variables of other controllers using $this->load->module(’module/controller’); or simply $this->load->module(’module’); if the controller name matches the module name.

Any loaded module controller can then be used like a library, ie: $this->module_controller->method(), but it has access to its own models and libraries independently from the caller.

This part is incorrect. If I do:

$this->load->module('news/admin');

$this->news_admin->index(); does not work, but $this->admin->index(); does.


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]gvillavizar[/eluser]
I have the MX_Config error too.

In my xampp installation the site is working great, but when I change the config settings and upload the file to the server I get this error:

Code:
Fatal error: Class 'MX_Config' not found in /home2/<name>/public_html/application/third_party/MX/Base.php on line 71

Why does it work local, and not online?

I created a application/libraries/MY_Config.php with the following content:

Code:
&lt;?php (defined('BASEPATH')) OR exit('No direct script access allowed');

require APPPATH."third_party/MX/Config.php";

class MY_Config extends MX_Config {}

When I upload that class, then the error disappears, but then the site can't load a single model.

How can I solve this?

Thanks in advanced.


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]wiredesignz[/eluser]
@wilso417, Yes MX/Base.php does get loaded when you use the HMVC features of Modular Extensions, when controllers extend the MX_Controller class.

The application/config/autoload.php file is processed by Codeigniter before Modular Extensions comes into effect if you are not using HMVC.

@gvillavizar, Are there any other PHP errors occurring before the fatal error?


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]wilso417[/eluser]
So @wiredesignz,

I would need to change all my controllers to extend from MX_Controller? Can't I use base.php instead of CI.php? They both create the CI class. For some reason my template library which is set to load in application/config/autoload.php is not loading automatically.

Were you able to reproduce the issue with $this->load->module('news/admin') not loading as $this->news_admin?


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]gvillavizar[/eluser]
[quote author="wiredesignz" date="1288318082"]@wilso417, Yes MX/Base.php does get loaded when you use the HMVC features of Modular Extensions, when controllers extend the MX_Controller class.

The application/config/autoload.php file is processed by Codeigniter before Modular Extensions comes into effect if you are not using HMVC.

@gvillavizar, Are there any other PHP errors occurring before the fatal error?[/quote]

No. That's the only error I see and again, it is working perfectly on my localhost.


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]wiredesignz[/eluser]
@wilso417, Sorry the module loader has never functioned this way. The controller is always referred to by its class name. The documentation provides examples and is not supposed to be taken literally. Although I think your example is not a bad idea. Wink

@gvillavizar, Please ensure you have error_reporting(E_ALL) and check php.ini paths and display_errors settings. it seems that some PHP installations (paths) can cause this error and/or hide other errors.


Modular Extensions - HMVC version 5.3 - El Forum - 10-28-2010

[eluser]gvillavizar[/eluser]
[quote author="wiredesignz" date="1288319309"]@wilso417, Sorry the module loader has never functioned this way. The controller is always referred to by its class name. The documentation provides examples and is not supposed to be taken literally. Although I think your example is not a bad idea. Wink

@gvillavizar, Please ensure you have error_reporting(E_ALL) and check php.ini paths and display_errors settings. it seems that some PHP installations (paths) can cause this error and/or hide other errors.[/quote]

I double checked and everything seems fine. I have other CI installations on the same server.

What I'm gonna do is delete all the files then upload a clean copy of CI, then a clean copy of HMVC and if its working right, I'll just have to drop the modules (in the end that's the advantage of HMVC right?). I'll post here if I get another error.

Thank you for your help!