Codeigniter HMVC : Error on running controllers having same name from different module name

StackOverflow https://stackoverflow.com/questions/15430117

سؤال

I'm using Codeigniter 2.1.3 with HMVC (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/overview)

I've tried to run two modules in a view as shown below

<?php 
echo Modules::run('contact/mosite/contactform');  
echo Modules::run('social/mosite/facebook');  
?>

First module is running well, but second got failed to run.

If I run only second module, it will works fine.

I think the issue is on the controller name, both controller have same name.

How to fix this issue?

هل كانت مفيدة؟

المحلول

Well, if this is because of same name (I'm not sure) then I think you can use namespace and to do this you can use this patch to allow namespacing in CodeIgniter. I didn't use/test it but it works fine as other claimed.

Important : This patch replaces the core Codeigniter.php file so be aware of that.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top