• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modular Extensions - HMVC version 5.3

[eluser]redcloud80[/eluser]
The last one proposed it's not really modular. Subcontrollers modules cannot be ported easily to other project without "picking" each component from common models/controllers/views/libraries/etc directories. Anyway I appreciate your suggestion!

[eluser]InsiteFX[/eluser]
If your MY_Controller is extending the CI_Controller then you are using Modular Separation not HMVC

For true HMVC your MY_Controller needs to extend MX_Controller.

Module Structure:

Code:
modules
-- module_name
---- config - can hold routes.php etc;
---- controllers - the controller_name should be the same as the module_name.
                            If not then you have to access using module_name/controller_name
-------- module_name - controller
-------- other_controllers
---- libraries
---- models
---- views

You should be able to have other directories but then you have to access then in order 1/2/3/controller etc;

[eluser]ivantcholakov[/eluser]
@redcloud80

It is matter of semantics what is really modular. If your "subcontrollers" folder is named "admin", then OK, avoid the third way. The routes.php rules might be a better choice, I have seen it within PyroCMS.

For "admin" there is the fourth way - a separate application, but that is a long story.

[eluser]Gwynbleidd[/eluser]
Hello,



I have a CI project with Modular Extensions - HMVC correctly installed.

I try to have one database settings per module.

So, I have one application/modules/module/config/database.php file in order to create different values for these objects :
- $active_group & $active_record variables
- $db array

And I would like that this file overwrites the default settings defined in the application/config/database.php file.

Code:
- application
--- config
------ database.php
--- modules
------ module
--------- config
------------ database.php

This doesn't work, CI doesn't load the module/config/database.php file.

Maybe I need to change some settings in autoload file ?

Thanks to help me.

[eluser]InsiteFX[/eluser]
CI only loads it from application/config, you can set different configs in the database.php and then
switch them later. See the database configuration in the Users Guide.



[eluser]Gwynbleidd[/eluser]
Yeah I know that but I wanted know if there's no way to load it from module/config with HMVC.

Because as you say, if I set different configs in the database.php I should switch them later with different value for $active_group.

You seem tell me that it's impossible, so I will change the $active_group value in my constructor method of my controller.

Thanks.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
2 Guest(s)


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