I apologize for not keeping up with this thread for the past five weeks though I've slowly come to realize over time what I think I'll have to do to build my own MVC.
As I've been building my site's CMS system I have modules such as the blog and forums. One of tonight's goals has been to reduce the existence of the h1 element to a single occurrence in a single template file. Currently (since I last worked on the blog and forum in November and December of last year) I have all the XHTML code including the headers there. The issue is that while I want to keep the blog and forums as separate modules there is the need for some merging of code, particularly the PHP classes and MySQL queries.
So to successfully have the title and h1 elements be exactly what I want them to be while only each having a single occurrence in all my code I've determined albeit somewhat vaguely that I will need to execute (at least) some of the MySQL queries for those modules and assign the general template values at an earlier step then how they are currently being determined.
I think it's a bit vague though I am pretty certain I'm understanding the concept with a little more clarity.
So in real world application having a single h1 and title element in all my code would be part of the presentation layer.
So here I am looking at this...
http://www.tonymarston.co.uk/php-mysql/ ... l#together
User --> Controller --> Model --> View
User --> The user requests blog or forum page.
Controller --> Controller needs to create PHP classes.
Model --> XHTML template files echos class data determined in the controller.
View --> Sent to the client.
This is my general understanding now...in application to what I want to do.
What I am thinking now is that I have a general CMS class file. How I will determine the h1/title will be different according to the section of my site requested (blog, forums, regular page, etc).
1.) So I first have to dictate the section requested (which I already have).
2.) I have to call up the section specific processing...where I store the title for a blog will likely be different then a forum in example. I determine the variables and eventually assign those variables to the generic $cms class variables.
3.) The model simply being XHTML templates has to simply do something like echo
'<title>'.$cms->title.'</title>';.
So in general how accurate/close am I with this example in my mind to how MVC works?