To make life a little easier for myself I would like to build a very simple template engine for my projects. Something I had in mind was to have .html files in a directory that get included to a page using PHP when I want them. So a typical index.php
would look like this:
<?php
IncludeHeader("This is the title of the page");
IncludeBody("This is some body content");
IncludeFooter();
?>
Something along those lines, and then in my template files I'd have:
<html>
<head>
<title>{PAGE_TITLE}</title>
</head>
<body>
But one thing I can't work out how to do is get the parameter passed to the functions and replace {PAGE_TITLE}
with it.
Does anyone have a solution or perhaps a better way to do this? Thanks.