简体   繁体   English

在Codeigniter PATH中调用Controllers模型和视图

[英]Call Controllers models and views in codeigniter PATH

I have to use method of a controllers created in codeigniter path: 我必须使用在codeigniter路径中创建的控制器的方法:

模块文件夹

In my controller(application/controllers/examplecontroller.php) i have to load modules controller that call modules models and modules views. 在我的控制器(application / controllers / examplecontroller.php)中,我必须加载调用模块模型和模块视图的模块控制器

It is possible in codeigniter??? 有可能在codeigniter ???

EDIT: 编辑:
I have my controller in application/controllers/hello.php. 我的控制器位于application / controllers / hello.php中。
Here i have to load a modules that have a controller called for example news.php in folder modules/controllers. 在这里,我必须加载一个文件夹控制器/文件夹中的模块,该模块具有一个名为例如news.php的控制器。 This news controller, call a model in modules/news_model.php that load news from my DB. 此新闻控制器在modules / news_model.php中调用一个模型,该模型从我的数据库中加载新闻。 Then, in the controller i have to call a view in modules/views allnews.php that show my news!! 然后,在控制器中,我必须在显示我的新闻的模块/视图alln​​ews.php中调用视图!
In codeigniter controllers, models and views are in application path! 在codeigniter控制器中,模型和视图位于应用程序路径中! I have to load cotnrollers, models and views in another folder then codeigniter/application path! 我必须将cotnrollers,模型和视图加载到另一个文件夹中,然后再加载codeigniter /应用程序路径!

是的,您可以执行此操作,但是它在应用程序文件夹中以及它的HMVC Codeigniter资产基本上用于javascript,图像或其他文件或css文件

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

相关问题 CodeIgniter中的Wordpress函数? (控制器,模型和视图) - Wordpress Functions in CodeIgniter? (Controllers, Models and Views) Laravel 5-更改模型,视图,控制器路径 - Laravel 5 - Change Models,Views,Controllers path 在CodeIgniter中的各个项目之间共享控制器,模型和视图 - Sharing controllers, models and views between separate projects in CodeIgniter 访问模型/控制器中的视图 - Access views in Models/Controllers CodeIgniter模型和控制器混淆 - CodeIgniter Models & Controllers Confusion CodeIgniter /胖模型/瘦控制器 - CodeIgniter / Fat Models / Skinny Controllers CodeIgniter:实现外部对象(不是模型,视图或控制器的对象)的最佳方法? - CodeIgniter: Best way to implement External Objects (Objects that aren't models, views, or controllers)? Codeigniter:在模型和控制器,模型和模型,控制器和控制器之间使用变量的最简单方法 - Codeigniter: easiest way to use variables between models and controllers, models and models, controllers and controllers Yii2 ::将控制器,模型和视图移动到子文件夹 - Yii2 :: Move controllers, models and views to subfolders 为什么模型在路径和控制器中起作用而在视图中不起作用? - why do the Models work in routes and in controllers but not in views?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM