title = $string; $this->meta = $string2; $this->load_files($array); } //set the main body of the html. Defined in the main document function setBody($string) { $this->body = $string; } // define any extra javascript code to go into the file. function setJavascript($string) { $this->javascript = $string; } function setTitle($title) { $this->title = $title; } ///////////////////// DATA MODEL PART 2 - EDIT AND FORMAT DATA /////////////// //function to take an array of dependent files and load them into HTML or PHP function load_files($array) { foreach($array as $value) { $temp_array = explode(".", $value); switch ($temp_array[1]) { case "incl": case "php": require($value); /*loads php files using require function */ break; case "css": /*prep css code for loading via html */ $this->filestoload .= "\t\t\n"; break; case "js": /*prep javascript code for loading via html */ $this->filestoload .= "\t\t\n"; break; default: break; } } } // function to return head information function page_head() { $head = "\n"; $head .= "\n\n"; $head .= "\n\n"; $head .= "\tmeta . "\" />\n\n"; $head .= "\t" . $this->title . "\n\n"; if ($this->javascriptArray != "") { $head .= javascriptLink($javascriptArray); } $head .= $this->filestoload; $head .= "\n\n"; return $head; } ///////////////////// DATA MODEL PART 3 - DISPLAY DATA /////////////// function display_html() { echo $this->page_head(); echo "\n\n"; echo $this->body; echo "\n\n"; if ($this->javascript != "") { echo "\t\n\n"; } echo "\n\n"; echo ""; } } ?>