简体   繁体   中英

CodeIgniter HMVC: Correct way of communicating with other modules?

Lets say I have 2 modules: A and B.

If I want to call a function in one of the models of module B from module A, what is the correct way?

Should the communication between modules only happen between controllers or I can call directly a model from module B in a controller form module A?

Thanks.

follow the steps below

1) load model of B from A module like $this->load->model("b_model");

2) if your function name is user then call like this $this->b_model->user();

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