简体   繁体   English

在CodeIgniter中的各个项目之间共享控制器,模型和视图

[英]Sharing controllers, models and views between separate projects in CodeIgniter

Kohana, due to cascading file system and modules, allows to share code in common projects, that contains controllers, views and models directories. 由于文件系统和模块的级联,Kohana允许在包含控制器,视图和模型目录的常见项目中共享代码。 How can I do it in codeigniter? 我该如何在Codeigniter中执行此操作? I want to create sites, that will share some code (admin area views, some models). 我想创建将共享一些代码(管理区域视图,某些模型)的站点。 That is easy in Kohana, we just have to add another directory for Kohana::find_file(). 在Kohana中这很容易,我们只需为Kohana :: find_file()添加另一个目录即可。

I'm more experienced in Kohana than CI but if I'm right there is a HMVC module in CodeIgniter. 我在Kohana方面比在CI方面更有经验,但是如果我是对的话,CodeIgniter中有一个HMVC模块。 You could see if you are able to request a external page like you can with the HMVC of kohana. 您可以看到是否能够像使用kohana的HMVC一样请求外部页面。

If I may ask. 如果我可以问。 why do you use codeigniter when you know kohana does the job better? 当您知道kohana做得更好时,为什么还要使用codeigniter?

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

相关问题 CodeIgniter中的Wordpress函数? (控制器,模型和视图) - Wordpress Functions in CodeIgniter? (Controllers, Models and Views) 在Codeigniter PATH中调用Controllers模型和视图 - Call Controllers models and views in codeigniter PATH Codeigniter:在模型和控制器,模型和模型,控制器和控制器之间使用变量的最简单方法 - Codeigniter: easiest way to use variables between models and controllers, models and models, controllers and controllers 如果局部视图使用不同的模型,是否需要单独的控制器? - Do Partial Views Need Separate Controllers if they Use Different Models? 共享不同控制器的视图 - Sharing views for different controllers 访问模型/控制器中的视图 - Access views in Models/Controllers CodeIgniter模型和控制器混淆 - CodeIgniter Models & Controllers Confusion 在控制器和模型之间移动数据-Codeigniter最佳实践 - Moving Data between Controllers and Models - Codeigniter Best Practices CodeIgniter /胖模型/瘦控制器 - CodeIgniter / Fat Models / Skinny Controllers CodeIgniter:实现外部对象(不是模型,视图或控制器的对象)的最佳方法? - CodeIgniter: Best way to implement External Objects (Objects that aren't models, views, or controllers)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM