Created Tuesday 21 January 2014
- The URL structure should follow the standard MVC pattern of http://domain/controller/action/id, where action and id is optional.
- Index.php will be our main "landing page", and is the single point of entry for all requests.
- Index.php will establish a "loader" object which is responsible for translating the requested URL into an instance of the relevant controller class, and then executing the requested "action" (i.e. method) on that controller instance.
- Our controller instance will have a basic level of validation and error handling regarding any bad requests in the URL.
- Controller actions/methods are responsible for creating an instance of the relevant model and sending the model's return data to the appropriate view.
- Views can be either stand-alone or use a template (in practical terms, this means views could return AJAX friendly content or normal browser based page requests).
- All controllers, models and views are individual files organized in relevant folders of the same name. The views folder has a subfolder for each controller. Controllers and models files are individual PHP classes, while views files are PHP capable, but mostly containing markup (XML, XHTML etc).
- Controller actions/methods are paired with their view files by name (e.g. the URL /article/update has its view stored in /views/article/update.php).
- Controllers and Models each have a "base class" which they inherit/extend.