Welcome Guest, Not a member yet? Register   Sign In
Need help with HMVC
#4

[eluser]OES[/eluser]
Ok I had a quick play with this and got it working first time.

Quote:1) Start with a clean CI install.
2) Set $config[‘base_url’] correctly for your installation.
3) Access the URL domain/subdir/index.php/welcome => shows Welcome to CodeIgniter
4) Drop Modular Extensions libraries into application/libraries and application/helpers directories as specified.
5) Access the URL domain/subdir/index.php/welcome => shows Welcome to CodeIgniter
6) Create module directory structure application/modules/welcome/controllers.
7) Move controller application/controllers/welcome.php to application/modules/welcome/controllers/welcome.php.
8) Access the URL domain/subdir/index.php/welcome => shows Welcome to CodeIgniter
9) Create directory application/modules/welcome/views.
10) Move view application/views/welcome_message.php to application/modules/welcome/views/welcome_message.php
11) Access the URL domain/subdir/index.php/welcome => shows Welcome to CodeIgniter

Ok so lets break it down.

1-3. Its just a normal CI setup. So do this first and make sure it all works. So we will assume you have a basic setup.

4. Copy Controller.php & MY_Router.php into folder:
/system/application/libraries.
Copy debug_helper.php & modules_helper.php into folder:
/system/application/helpers

5. Just try you site and make sure its still working.

6. Create a folder called modules in:

/system/application/
So you will have : /system/application/modules/

Now create your first module so in this example its called welcome. then within welcome create your set of folders for it ie.

/system/application/modules/welcome/views/
/system/application/modules/welcome/controllers/
/system/application/modules/welcome/models/

7. Now move not copy !
/system/application/controllers/welcome.php
to
/system/application/modules/welcome/controller/welcome.php

8. Recheck site to make sure all is working.

9. Already done with my above step.

10. Now move not copy !
/system/application/views/welcome_message.php
to
/system/application/modules/welcome/views/welcome_message.php

11. Recheck and it should all be working.

Good luck.


Messages In This Thread
Need help with HMVC - by El Forum - 10-21-2008, 12:29 PM
Need help with HMVC - by El Forum - 10-23-2008, 05:56 AM
Need help with HMVC - by El Forum - 10-23-2008, 06:28 AM
Need help with HMVC - by El Forum - 10-23-2008, 06:30 AM
Need help with HMVC - by El Forum - 10-23-2008, 06:31 AM
Need help with HMVC - by El Forum - 11-23-2008, 02:49 AM
Need help with HMVC - by El Forum - 11-24-2008, 02:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB