CodeIgniter Forums
HMVC structure - 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: HMVC structure (/showthread.php?tid=40966)



HMVC structure - El Forum - 04-24-2011

[eluser]Ngulo[/eluser]
Hi Guys i'm looking for passing to a HMVC , is there anyone can suggest me the best one extension library for do that?

i see many wiki artices i' can't decide which is best Tongue


HMVC structure - El Forum - 04-24-2011

[eluser]InsiteFX[/eluser]
I cannot speak for the other users, but I use HMVC.

InsiteFX


HMVC structure - El Forum - 04-24-2011

[eluser]cmgmyr[/eluser]
I use Modular Extensions from Wiredesignz here. It works great and very easy to implement.


HMVC structure - El Forum - 04-24-2011

[eluser]Ngulo[/eluser]
Hi guys , really thanks for replying me Smile

i'm still testing HMVC as structure, so i followed installation steps here
https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home

starting from a CI 2.0.2 clear structure i installed HMVC.

I'm trying loading welcome.php controller from home.php controller located to application/controllers/home.php

i setted up also $route['default_controller'] = "home"

so i do :

home.php

Code:
<?php
class Home extends MX_Controller{

    function index(){

        
        $this->load->view('home_view');
    }
}

home_view.php
Code:
<?php echo modules::run('welcome/welcome');?>
but i still getting blank page going to www.mysite.com/index.php/home

thinking something i forgot from bitbucket installation steps .. uhm


HMVC structure - El Forum - 04-24-2011

[eluser]Ngulo[/eluser]
my app structure is like so:

application
- controllers
- home.php
- models
- views
- home_view.php
- modules
- welcome
- controllers
- welcome.php
- views
- welcome_message.php
- models


HMVC structure - El Forum - 04-24-2011

[eluser]cmgmyr[/eluser]
If you take out
Code:
<?php echo modules::run('welcome/welcome');?>
and replace it with a regular string, does everything load properly?


HMVC structure - El Forum - 04-24-2011

[eluser]InsiteFX[/eluser]
As cmgmyr said you do not need the module::run, just leave the default controller in application.config/routes to welcome and it should run!

InsiteFX


HMVC structure - El Forum - 04-25-2011

[eluser]Ngulo[/eluser]
[quote author="cmgmyr" date="1303709364"]If you take out
Code:
<?php echo modules::run('welcome/welcome');?>
and replace it with a regular string, does everything load properly?[/quote]

yes !


maybe i didn't understand HMVC logic, i mean, what to do and what i can do with regular application/models,application/views,application/controllers ?

need to delete them using only modules? or modules are parts i can load into regular application/controllers or views?


thanks guys Wink


HMVC structure - El Forum - 04-25-2011

[eluser]InsiteFX[/eluser]
No you should not delete the folders!

You can still use the normal CI folders along with the module folders.


HMVC structure - El Forum - 04-25-2011

[eluser]Ngulo[/eluser]
ohhh man you're right, my mistake was :

Code:
<?php echo modules::run('welcome/welcome');?>

to replace with

Code:
<?php echo modules::run('welcome/welcome/index');?>

now it works! Wink