So I've been doing some reading on what the model view controller is and from what I understand, it is pretty much a way to structure your application but I'm still not that sure and I need some help knowing if I understand the concept correctly.

If I start making a PHP app and I want to use the MVC hierarchy then setting up the folder structure would like so


Does this mean I'm "using MVC"? Also, I don't really know what files goes in which folder, I know that the View will handle the display stuff and the Controller will tell the view what to display and the Model is used to retrieve the information to display. Is that correct? So essentially, the model will contain the config file and the mysql_connect files. The Controller will have the files that uses include() or require() or require_once() to initialize the files and the view will contain mostly template files.

If my idea of what MVC is wrong, can you please help me understand it a bit better. Many Thanks -Charles

Yes, I have thought of it, that's how I came to learn the term MVC. This is just me trying to learn more about web development stuff. I'm still stuck dealing with simple websites so I never had a chance to use any frameworks yet but I want to get ready when that time comes.

Member Avatar

Perhaps start with something simpler like a templating engine (like a 'junior MVC' type thingy). I can recommend RainTPL.