| Rounded Corners for Mambo |
|
|
Page 2 of 3 How it works - The PHP First the general principle. We separate the 'what' we want to display from 'how' we display it. The 'what' is the content, like modules and even the main component. The 'how' is the structure, layout, presentation, css, images etc. The 'what' is all in index.php what used to be the whole mambo template. The 'how' is now in the patTemplate file, tmpl/page.html. The index.php pushes data like the module content into the template to make it available for display. The template engine is then used to draw (render) the template to the browser. Confused? Lets go over that slowly, looking at the example project, index.php The first part of the file creates the template engine and loads template file. // Create the template These lines:
The next section shows how to create content, and push it into the template engine as a variable. ob_start(); These lines:
The next section does a similar thing for each module, buy calling the function ark_loadModules ark_loadModules($tmpl, 'left', 'ark_page', 'LEFT'); ark_loadModules is called once for each module that you want to load. The ark_loadModules function uses the output buffering technique described above to capture the output of each module. Read on to part 3 for an explaination of the template file, page.html |
| < Prev |
|---|