

I did work for an online company they were building this entire social network site. Here's why you should use a template engine: I prefer to use smarty and keep HTML and PHP separate, I highly recommend this! I personally use Smarty but there's tons of template engines out there. Not the greatest example but it might help.
PHP ECHO BREAK CODE
Anywhere in your code you could run "fetchData('weather') " and it would do all the database queries for you and return you the weather in one line without messing with the database in your logic code. In procedural programming you could have a single function that handles all the data stuff (admittedly this muddies the idea of MVC quite a bit) called "fetchData()". yeah)Įdit: Also if you don't have experience with Object-Oriented Programming the idea of "objects" can be confusing, especially when trying to wrap your head around MVC. "Hey lady, give me my medical records!" "Okay here they are!" She isn't the medical records - but she handles getting them and putting them away (as well as updating and deleting them but. You just need them so you ask her and she gets them. You have no idea her filing system or where they are and you don't care. Think of the model as the nice lady behind the window that fetches your files for you. (The View has no clue what just happened and it doesn't care how the info got there, just that it needs to display it) The controller then sends that information along to the View where it's made pretty and given to the user.
PHP ECHO BREAK HOW TO


I have a basic "template" I'm using, which is the html and css code for the head and formatting of my website. I'm probably 100% wrong in how I'm doing this, but let me explain how I have it setup. Right now I have a webpage/site hosted from home. I don't quite follow your code since I've been procedurally writing all my PHP, but now I'm thinking I should move towards OOP. NET at work and have chosen to not bother with webforms and to try my hand at MVC 2. I'm a bit of a newb with PHP and this type of programming, I've been trying to figure out how/what MVC is.

I'm happy this topic got posted, even happier for your response.
