Writing a Template System in PHP - The Class Skeleton
(Page 4 of 9 )
Now armed with the knowledge of how template files would be structured and how I wanted the interface to look, I could start constructing the skeleton of the class:
<?php class Page { var $page;
function Page($template) {
}
function replace_tags($tags) {
}
function output() {
} } ?> |
The array $tags is keyed using the place holders and its values are the corresponding replacement data. The variable $page is used to store the page as it's being generated.
Next: Constructor and Output >>
More Display Tutorials Articles
More By bluephoenix
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|