function replace_tags($tags = array()) { if (sizeof($tags) > 0) foreach ($tags as $tag => $data) { $data = (file_exists($data)) ? $this->parse($data) : $data; $this->page = eregi_replace("{" . $tag . "}", $data, $this->page); } else die("No tags designated for replacement."); }
function output() { echo $this->page; } } ?>
After initializing the object with the name of the HTML template file, pass an array of place holders found within the template and the data files or information to the replace_tags method and use the output method to flush the processed page from the class to standard output.