{PHPHTML} HOWTO Author: Geraud P. Krawezik (gk@lri.fr) 1. Introduction 2. Page Creation 3. Template files and template instructions 1. Introduction 1.1 Why {PHPTMPL}? When designing a web site, one always faces the same problems: - how to separate the layout of the pages from the contents? - how to quickly change from one layout or graphical aspect to another? - how to update quickly the contents without having to do undreds of updates {PHPTMPL} is designed to enable web designers, graphics designers and 'contents maker' to work in perfect harmony and produce efficient sites quickly, without needing lots of knowledge about JavaScript, Java, HTML or PHP. Each member stays in his own domain, without needing to look into code he may experience difficulties to understand. {PHPTMPL} is based on an Object-Oriented model. But no need to be a C++ or Java expert to use it, neither a PHP one. Everything is explained in the following lines. I have chosen this model as it seems to be very convenient with the goals of {PHPTMPL}. 1.2 Structure of a web site The structure can be represented as the following tree: Site | |__ Section 1 | | | |__ SubSection 1.1 -> content | |__ SubSection 1.2 -> content | |__ Section 2 | |__ SubSection 2.1 -> content |__ SubSection 2.2 -> content |__ SubSection 2.3 -> content ... The content of a SubSection can be: - a String (then it will be displayed) - a text file (including HTML pages) - a PHP program which will be evaluated They all will be presented according to the layouts defined in the templates files 2. Page Creation (for the main developper of the site) 2.0 Generalities Here are presented the PHP functions you will need to create a site, add contents to it (through sections and subsections), and display it to the visitor of yur web site. To use those functions, you just need to include "[path to phptmpl]/PHPTMPL.php"; at the beginning of the main page of your site (which should usually be index.html or index.php). 2.1 Site 2.1.1 Creating a new Site Site(string name, string title, string url, boolean [hiddenParameters], string [templatePage], string [templatesDir]); - name: the internal name, mainly used as a dummy argument, for example in generic structutres like 'name_background.gif' - title: the title in 'clear' as it is for example displayed in the browser head - url: the complete or relative URL of the file Options: - hiddenParameters: a flag used to tell if the parameters (section, subsection) shall be passed through POST or GET. In the first case, they will be put inside a