PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Could someone explain how they build the different dynamic sections of their web app using MVC?
If my web appllication consisted of 3 columns how would I incorporate the other controllers for the side columns as well as the main content controller?
I would need a players controller for the main content, then how would I incorporate a latest news controller, top ten players controller, press articles controller etc for the side bars?
I've heard of the composite view but it doesn't make sense to me
Confused
Your three columns sound like separate Views, not Controllers. A View object has all the presentation logic in it needed to generate the output for that specific thing.
A controller acts to pull data together and construct a view. What the user sees is a single view and what appears to be a set of data.
Behind the scenes though the data can come from many spots, a set of database tables, an RSS feed, or whatever. The data is your model.
The view can be one template file or several template files that are put or data that is just echoed by the controller if you are hackish.
There should only be one controller method called that constructs the page, not many calls to many controllers.
So what you need to do is create templates for each of the parts of the page that you want to reuse, have the controller get the data needed for each part from the model, then render them. So you can create a model that gets your news data, a view that takes the data sent to it and turns it into an HTML snippet, then a model for players and a view etc. Then you are going to take the HTML generated by each of your views and stick it together into one nice web page.
If you are still confused you might want to read up a little bit about MVC on the web.