I now have a basic structure in place.
A HTTP URL parameter, called view, specifies the content to display on the page. The controller (index.php) sanitizes and stores this parameter in the $view variable.
A PHP class, HTMLComponents, is instantiated. This class is used by the template to place the elements of the page in the appropriate places.
The controller finishes by including the template (template/index.php). As stated, the template contains calls to methods on the HTMLComponents class, such as writeTitle(), writePageNav(), and writeMainBody(). This last takes $view as a parameter, and the function checks for 'modules/'.$view.'.php'. If this file exists, it is included, otherwise we include modules/home.php to generate the default content.
Objectives
- To reduce time from design to deployment
- to help maintain code quality
- to reduce need for maintanence and support
- to help ensure code meets specific requirements (including FF support, security, performance)
- to facilitate group work through standardization
- to grant designers the ability to easily understand the functionality available when they design a site
Possible Solutions
- Skeleton in the Library - Skeleton site and DB, complimented by a library which provides additional functionality
- Puppet Master - skeleton library and database provide all possible functionality, which is enabled/disabled through config files
- Building Blocks - a library provides compatible components; a site is built from 'scratch' by getting all required components from library
compton
12:57 pm, Friday, 23 February 07
The index.php page is the controller. The template could follow the Joomla concept: a formatted HTML page, with embedded calls to get content eg writeMainBody(), writeLeftNav(), writeFooter(), etc. If we do this, then it is these functions which need to determine the appropriate content for the page, rather than index.php. So, index.php follows this procedure: