Part of the EllisLab Network
   
11 of 11
11
Modular Extensions - (HMVC) - Version 2.1.8
Posted: 25 February 2008 07:26 AM   [ Ignore ]   [ # 101 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  286
Joined  12-25-2007

Modules is only a static helper class, it isn’t meant to be instantiated. The HMVC class is extended by your module… I suppose it could be called Module.

One last thing… I’m not sure if the Modular Extensions is just a helper or it is a library. For me, it is a library that have a helper inside. Even more, it is in the same level of Controller and Model libraries. In my opinion, it should go to “application/libraries”, with the name “Module.php”.

 Signature 

Oh God… Why didn’t you show me CodeIgniter before?

Profile
 
 
Posted: 25 February 2008 12:32 PM   [ Ignore ]   [ # 102 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  02-05-2007
Edemilson Lima - 25 February 2008 07:26 AM

Modules is only a static helper class, it isn’t meant to be instantiated. The HMVC class is extended by your module… I suppose it could be called Module.

One last thing… I’m not sure if the Modular Extensions is just a helper or it is a library. For me, it is a library that have a helper inside. Even more, it is in the same level of Controller and Model libraries. In my opinion, it should go to “application/libraries”, with the name “Module.php”.

If it was a library, then CI would instantiate it when it’s loaded. That doesn’t make sense. If you want to make it a true CI helper instead of a static class then change the methods. For example:

- run() becomes modules_run()
- so to call it, modules::run() becomes modules_run()

 Signature 

“I am the terror that flaps in the night”

Profile
 
 
Posted: 25 February 2008 01:20 PM   [ Ignore ]   [ # 103 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  286
Joined  12-25-2007

In my view, a helper is a standalone function and a library is a set of functions or classes that work together. It doesn’t matter if it can be instantiated or not, unless the library concept in CI only applies to intantiable classes. Anyway, I do prefer to use modules::run() than modules_run(). smile

By the way, what do you think about the version 3.0? Is it more a library than a helper or not?

http://codeigniter.com/forums/viewthread/72580/

 Signature 

Oh God… Why didn’t you show me CodeIgniter before?

Profile
 
 
   
11 of 11
11
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 61048 Total Logged-in Users: 17
Total Topics: 73850 Total Anonymous Users: 1
Total Replies: 398358 Total Guests: 307
Total Posts: 472208    
Members ( View Memberlist )