Hi All,
Ok so i know theres loads of php MVC products out there but Im writing my own version of the MVC pattern purely for the learning benefit and so i understand it!
Anyway i have a couple of quick design question in which im looking for the best or most common approach to solve.
So the questions are:
If my sections are mainly logically separate units e.g. Home, Guestbook, Site News, Users etc with a controller, model and view for each but on the home page i want to display a range of information from each section e.g. latest headlines, latest members, latest posts what is the best way to do this?
Theorys i have are:
[*]Bypass each units controllers and go straight to their model e.g. HomeController calls methods in NewsModel returns the data and renders it
[*]Keep it logically separate and write a HomeModel that contains the relevant db calls to the other units
[*]Some other weird and wonderful way i havent though of!
And additionally if i have a front controller that is processing and directing all my requests to the required controller which is processing the data and rendering a template what is the best way to process ajax requests? Am i over complicating and should just have the server side method just echo back to the ajax script or should i append a GET param of callType=ajax and process differently?
I know design is never an exact science but am just curious what ideas/suggestions are out there!
Cheers all!
Ross