简体   繁体   中英

Codeigniter HMVC load view of loaded module

I am using the Codeigniter HMVC from https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc and I want to load a module using the Modules::run('site1') using the view of the said module.

Example:

- modules
   - site1
      - controllers
      - views
   - site2
      - controllers
      - views

On site1, I loadded the site2 module using Modules::run('site2/login'); the problem is that it is loading the views of site1 instead of site2 giving me an error of ".. site1/login does not exists".

It should be loading the views of the site2.

Thanks in advance!

I think I found the problem. I was using the $this->load->view($this->router->class . '/login'); and the router class is already my site1 instead of the site2. Is there an easy way for me not to change all the $this->router->class to 'site2'?

Since the part controller is now site1 and site2 is just being loaded as a module, it overrides the $this->router->class from site2 to site1. Is there a way for me to still get the class name of the site2?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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