MVC框架的理想文件夹结构 [英] Ideal Folder Structure of MVC framework

查看:114
本文介绍了MVC框架的理想文件夹结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一个MVC框架理想的文件夹结构是什么,它应该能够支持多个安装。例如,我安装了xyz框架,并基于此xyz框架的单个安装运行了两个或多个站点,而不是为每个站点安装该框架。

I would like to ask what is the ideal folder structure for a MVC framework that should be able to support multiple installations. For example, I install xyz framework and i run two or more sites based on this single installation of xyz framework rather than installing the framework for each site.

在Codeigniter中也可以,但是我对CodeIgniter的了解不多,所以我需要您的建议。我知道你们中有些人可能比CodeIgniter做的更好,所以请分享。

This is probably done in Codeigniter too but i don't know much about CodeIgniter, so i need your suggestions. I know some of you might even have better idea than what is done by CodeIgniter, so please share.

推荐答案

我的MVC库结构的通用示例。没什么,我想保持简单。

This is, a generalized example, of my MVC library structure. Nothing fancy, i wanted to keep it simple.

Library
    - Configuration
    - Modules (Database adapters etc)
    - Core (Abstract controllers, routing functionality etc)
Application
    - Model
    - View
    - Controllers
    - Helpers

这种结构的好处是库不(不应该)依赖于库。这意味着您可以复制该库以用于其他项目。

The benefits with this structure is that the library is not (which it shouldnt) dependent of the library. That means that you can copy the library for use with other projects.

这篇关于MVC框架的理想文件夹结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆