开发者

Internal forward action in CodeIgniter

开发者 https://www.devze.com 2023-02-07 17:59 出处:网络
In Zend Framework, we can easily forward to an acti开发者_Python百科on in another controller using the _forward().

In Zend Framework, we can easily forward to an acti开发者_Python百科on in another controller using the _forward().

How to simulate this in CI? CI only have redirect but this is not I want, I don't want user to see the URL has changed in their browser.

Any idea to implement it?


I know for a fact that you can forward to another action inside the same controller without changing the url., with

$this->action();

Other than that, I do not see a built in way to access other controllers

This concept actually seems to break a more strict view of the MVC model, and this functionality you are trying to implement might be better suited for a library.


This sounds like HMVC (Hierarchical MHV) - i.e. controllers being able to load controllers without having to go through the HTTP interface again. You can install a package called Modular Extensions (by wiredesignz). Get the very latest from bitbucket, https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/overview.

Note that support for codeigniter V1.7 has been recently discontinued, so you'll need to user CI V2.0

0

精彩评论

暂无评论...
验证码 换一张
取 消