1.11M Members

Understading the MVC

 
0
 

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

APP
   >Includes
      >Model
      >View      
      >Controller
   >public
      >index.php

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

 
0
 

Have you thought about a framework? Symphony or the like?

http://www.symfony-project.org/

 
0
 

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.

 
0
 

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

Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: