We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,874 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Understading the MVC

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

2
Contributors
3
Replies
17 Hours
Discussion Span
2 Years Ago
Last Updated
4
Views
qazplm114477
Junior Poster
193 posts since Apr 2010
Reputation Points: 24
Solved Threads: 39
Skill Endorsements: 0

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

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

diafol
Keep Smiling
Moderator
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57

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.

qazplm114477
Junior Poster
193 posts since Apr 2010
Reputation Points: 24
Solved Threads: 39
Skill Endorsements: 0

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

diafol
Keep Smiling
Moderator
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0638 seconds using 2.66MB