dongnaoxia0927 2010-02-25 20:53
浏览 45
已采纳

CodeIgniter中的模块化体系结构

the idea

I'm playing with a concept of modular website builder - now mostly in theory, which would containt pages / collections based on modules (either preprogrammed or done specifically when needed).

Every module with come with it's ties to DB, views/templates and core data processing, I'm thinking about factory pattern:

basic module wrapper - having normalized names -> callDB, processData, returnToTemplate

each module then inherits this wrapper and just adds it's calls to DB, it's data processing and finally will return to data, then in application, I will just do something like:

$this->modules->each->callDB(); //obviously, pseudo-PHP

the problem

What am I struggling with, however, is incorporating this whole idea into CodeIgniter's MVC approach and it's data structure, so it won't be/feel (i know, subjective) unnatural and/or meaningless.

Any ideas?

(under tree structre i - i know, that i can do whatever i like. However, I don't know if I like dir modules with subir for each module, or templates in application/templates and modules in application/modules - and those modules, it actually doesn't make sense to me, since my modules are somewhat different than CI modules... you know...)

edit1

So... is this so hardcore or so dumb that there are no answers??

  • 写回答

2条回答 默认 最新

  • droe9376 2010-02-26 10:54
    关注

    What exactly are you trying to achieve? There is plenty of code out there to help you achieve modular architecture (HMVC) in your CodeIgniter application.

    Modular Separation - wiredesignz

    Matchbox - Zacharias Knudsen

    Anything else you need to add in relating to wrapping the module is purely in the implementation. I'd look into using MY_Controller and possibly taking it a step further to implement multiple base classes, so your frontend controllers know to wrap the module with whatever data from the DB.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效