views:

654

answers:

2

Hello guys,

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.

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.

+3  A: 

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.

alexn
K Prime
thanks for youre reply, looks good
Sarfraz
How any sane programmer could make it the other way, where framework and application files are mixed, is beyond me :p
Bart van Heukelom
A: 

And if I want to build store, where should I put all images and other stuff needed for that? Should they be inside of this two basic folders for MVC or I should make another separate folder, for example:

Public
 - css
   - style.css
 - js
   - scripts.js
 - img
   - example.png
Eugene
You should really call those folders stylesheets, javascripts and images. :)
Smickie
@smickie That's completely subjective
Justin Johnson
@Eugene This is not a forum. If you have a question, open a new question.
Justin Johnson