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 - 09-22-2010

[eluser]Phil Sturgeon[/eluser]
Thats a cool way of doing it. Personally I now avoid using $this->data wherever possible and keep all of those in $this->template->foo with __get/__set.

The properties I'm assigning to $this-> are more like constants, but objects for use internally in models and libraries. It sounds disgusting but you should see the damn size of this CMS. 30 modules, 40 models, 20 libraries and pretty much EVERY single call needs to know what site ($this->site) what language ($this->language) etc. It's not perfect, its not pretty but it IS necessary.


Modular Extensions - HMVC version 5.3 - El Forum - 09-22-2010

[eluser]wiredesignz[/eluser]
@phil, Ok thats cool too. Keeps it all tidy and accessible. Good work.


Modular Extensions - HMVC version 5.3 - El Forum - 09-22-2010

[eluser]newkiwi[/eluser]
@phil
@wiredesignz

Thanks - nice clean solution Phil.
The ci() function is also neat and DRY - beats declaring $this->ci = & get_instance() in every library etc

Maybe you could consider the merit of having this solution, i.e. the _get() and the ci() function included by default in HMVC as a standard feature/functionality.

...placed probably in the MX_Controller else MY_Controller file.


Modular Extensions - HMVC version 5.3 - El Forum - 09-22-2010

[eluser]Philipp GĂ©rard[/eluser]
@wiredesignz: Sorry for the bad description, I should know better as a developer Wink. I simply copied all the files over to their designated folders using a fresh copy of CI 2.0 from the repository and your files from your repository. I did not edit any file whatsoever and still only get the following error:

Code:
Fatal error: Class 'MX_Config' not found in /home/philippgerard/domains/philippgerard.de/public/codeigniter2/frontend/third_party/MX/Base.php on line 74



Modular Extensions - HMVC version 5.3 - El Forum - 09-22-2010

[eluser]ardinotow[/eluser]
[quote author="ardinotow" date="1285146484"][quote author="wiredesignz" date="1285144148"]
If you also use MY_Language.php and/or MY_Config.php you must include (require) the corresponding MX/Lang.php and MX/Config.php files[/quote]
Yes, solved! Thank you so much !![/quote]
Hate to bother you again wire, but I got another problem. Modular system have worked on my office using above solution but when I try on my home I got nothing on my screen (no error message, just white background). I've tried to delete all Modular Separation files and I got it working again without modular system.

Here is my log when accessing modular:
Code:
DEBUG - 2010-09-22 15:03:48 --> Config Class Initialized
DEBUG - 2010-09-22 15:03:48 --> Hooks Class Initialized
DEBUG - 2010-09-22 15:03:48 --> URI Class Initialized
DEBUG - 2010-09-22 15:03:48 --> Router Class Initialized
DEBUG - 2010-09-22 15:03:48 --> Output Class Initialized
DEBUG - 2010-09-22 15:03:48 --> Input Class Initialized
DEBUG - 2010-09-22 15:03:48 --> Global POST and COOKIE data sanitized
DEBUG - 2010-09-22 15:03:48 --> Language Class Initialized

I'm using the same server environment as on my office. Please help me again...thanks!


Modular Extensions - HMVC version 5.3 - El Forum - 09-22-2010

[eluser]ardinotow[/eluser]
I forgot to mention that on my office is using LAMPP 1.7.1 which is using PHP 5.2.9 while on my home is using LAMPP 1.7.3a which is using PHP 5.3.1. Is it PHP compatibility issue?


Modular Extensions - HMVC version 5.3 - El Forum - 09-22-2010

[eluser]wiredesignz[/eluser]
It may be a Modular Extensions issue with PHP5.3 but you may also have errors in your own code and most likely have PHP error_reporting turned off.


Modular Extensions - HMVC version 5.3 - El Forum - 09-23-2010

[eluser]Phil Sturgeon[/eluser]
Now I have switched to using MX_Controller I am getting:

Quote:An Error Was Encountered [ 500 ]

Unable to load the requested language file: language/english/main.php

That is from the same autoload line that fixed things before. Not sure why this makes a difference and it only happens on some pages, but its an autoloaded file so it should be loaded all the time, not just some.

I can swap back and forward between extending Controller and MX_Controller, it will work for Controller and break for MX_Controller so it feels more like a bug in ME than my own code. If it is a bug in my own code I could use some help debugging it.


Modular Extensions - HMVC version 5.3 - El Forum - 09-23-2010

[eluser]Phil Sturgeon[/eluser]
Aha, it happens on controllers that are not in a module.


Modular Extensions - HMVC version 5.3 - El Forum - 09-23-2010

[eluser]wiredesignz[/eluser]
So this is application/config/autoload.php attempting to load a language?

And you have a MY_Lang.php in the application/core directory which includes (requires) MX/Lang.php?