Welcome Guest, Not a member yet? Register   Sign In
HMVC - different module with same controler name
#1

[eluser]Unknown[/eluser]
so lets say i have 2 modules like this
Code:
/application
    /modules
        /moduleA
            /controllers
                default_controller.php
            /models
            /views
        /moduleB
            /controllers
                default_controller.php
            /models
            /views

on each module, i need default controller to assume it as the main controller but i dont want name it like module name, so i always create default_controller.php in controller as the main controller.

and now the problem lead to when i going to call each main controller from modules, let say something like this

Code:
<?php
echo Modules::run('moduleA/default_controller/index');
echo Modules::run('moduleB/default_controller/index');
?>

and the results are there are 2 output from moduleA. in my opinion, i cant load two or more modules at the same time with same controller/class name because it will lead us to the firs module we call. and for note i already extends MX_Controller on each controller.

any idea about this?
#2

[eluser]InsiteFX[/eluser]
A Controller is a class and no two classes in php can have the same name, you need to change the name of one of your Controllers.




Theme © iAndrew 2016 - Forum software by © MyBB