CodeIgniter Forums

Full Version: Need help with HMVC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]edwin87[/eluser]
Hello CI,

Im trying to get a Modular Extension: HMVC installed. But i followed the steps on the wiki page. And i can't get a result.

Does anyone knows a solution of this? I exactly followed that instructions and still a 404 page. Till step 6 it goes nice.


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

El Forum

[eluser]edwin87[/eluser]
Anyone?

El Forum

[eluser]manilodisan[/eluser]
Any error being sent to the browser?

El Forum

[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.

El Forum

[eluser]edwin87[/eluser]
Yes! Finally it works.

I see that i can't call a module in this way?

cms/modulename/view

Normally that works.

But do i need to call a module every time like:
Code:
<?php echo module::run('modulename');  ?>
?

El Forum

[eluser]Reynolds[/eluser]
hi, i just installed ME-HMVC, I got it working, but my question though is...

why is it that if i called it this way, it works:

http://localhost/website/sample/welcome


but not

http://localhost/website/sample


i get an error:

Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.

subdir: /website/
controller:welcome
module name: sample

I remember I had this working, but I forgot if its HMVC, or other library. I haven't taken a look at my old code, which has the modular library working.

I appreciate your help, thanks :cheese:

El Forum

[eluser]edwin87[/eluser]
I think you're controller must be the same as the name sample.

So Controller: sample
Module sample