I have my own mini-template thing like this: function template($content) { global $title; global $main; global $menu; global $userinfo; $filename = "./themes/theme.html"; if(!$fd = fopen($filename, "r")) { $error = 1; } else { $template = fread ($fd, filesize ($filename)); fclose ($fd); $template = stripslashes($template); $template = eregi_replace("<% title %>", "$title", $template); $template = eregi_replace("<% main %>", "$main", $template); $template = eregi_replace("<% content %>", "$content", $template); $template = eregi_replace("<% menu %>", "$menu", $template); $template = eregi_replace("<% userinfo %>", "$userinfo", $template); echo "$template"; } } function home() { global $title; global $main; global $menu; global $userinfo; Code (markup): Would that be good enough for a decently large php site or would it be better to use a template engine. Which I have no clue how to use (Ex. Smarty)
If your site is complex with a lot of pages and has a lot of traffic and stress on the server then I would go with something like Smarty because it has built in caching. If not then your template engine you made would work perfect.