简体   繁体   English

从CodeIgniter中的其他文件夹加载控制器

[英]Loading controllers from different folder in CodeIgniter

In CodeIgniter, I can use $autoload['packages'] to specify additional locations for libraries, models, and helpers. 在CodeIgniter中,我可以使用$autoload['packages']为库,模型和助手指定其他位置。 But how do I specify additional locations for controllers. 但是,如何为控制器指定其他位置。

What I want is this: If a URL specifies controller xyzzy , CodeIgniter should first look for the usual application/controllers/Ctrl_xyzzy.php file, and if it doesn't find it, it should look for other_place/controllers/Ctrl_xyzzy.php instead. 我想要的是:如果URL指定了控制器xyzzy ,则CodeIgniter首先应查找常规的application/controllers/Ctrl_xyzzy.php文件,如果找不到,则应查找other_place/controllers/Ctrl_xyzzy.php

Is that possible? 那可能吗?

For calling a controller from another controller you need to use HMVC 要从另一个控制器调用一个控制器,您需要使用HMVC

refer this link https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc 请参阅此链接https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

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

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