1,105,406 Community Members

Understading the MVC

Member Avatar
qazplm114477
Junior Poster
193 posts since Apr 2010
Reputation Points: 14 [?]
Q&As Helped to Solve: 40 [?]
Skill Endorsements: 0 [?]
 
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

Member Avatar
diafol
Where are my eyes?
12,986 posts since Oct 2006
Reputation Points: 1,821 [?]
Q&As Helped to Solve: 1,849 [?]
Skill Endorsements: 92 [?]
Moderator
Featured
Sponsor
 
0
 

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

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

Member Avatar
qazplm114477
Junior Poster
193 posts since Apr 2010
Reputation Points: 14 [?]
Q&As Helped to Solve: 40 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
diafol
Where are my eyes?
12,986 posts since Oct 2006
Reputation Points: 1,821 [?]
Q&As Helped to Solve: 1,849 [?]
Skill Endorsements: 92 [?]
Moderator
Featured
Sponsor
 
0
 

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

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