简体   繁体   English

HMVC模块阵列Codeigniter

[英]HMVC Modules array Codeigniter

I have array in my config and I get it to foreach. 我在我的配置中有数组,我把它带到了foreach。 It works ok but how can I get parameter from any modules. 可以,但是如何从任何模块中获取参数。 For example I want parameter 1 to custom/custom/index. 例如,我希望参数1为custom / custom / index。

Thank you for reply 感谢您的回复

$config['modules'] = array('calendar/calendar/index','randphoto/randphoto/index','feedback/feedback/index','survey/survey/index','custom/custom/index');

foreach ($this->config->item('modules') as $key) {
        echo Modules::run($key);
      }

If I try alone, it works fine but I want it in array echo Modules::run('custom/custom/index', 1); 如果我单独尝试,它可以正常工作,但我希望在数组echo Modules::run('custom/custom/index', 1);

use $this->uri->segment(3); 使用$this->uri->segment(3); This will give you the third parameter coming from URL. 这将为您提供来自URL的第三个参数。 For more read the user guide 有关更多信息,请阅读用户指南。

http://ellislab.com/codeigniter/user-guide/libraries/uri.html http://ellislab.com/codeigniter/user-guide/libraries/uri.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM